FEDRA emulsion software from the OPERA Collaboration
EdbShowAlg_SA Class Reference

#include <EdbShowAlg.h>

Inheritance diagram for EdbShowAlg_SA:
Collaboration diagram for EdbShowAlg_SA:

Public Member Functions

 ClassDef (EdbShowAlg_SA, 1)
 
 EdbShowAlg_SA ()
 
void Execute ()
 
void Finalize ()
 
void Init ()
 
void Initialize ()
 
virtual ~EdbShowAlg_SA ()
 
- Public Member Functions inherited from EdbShowAlg
void AddRecoShowerArray (EdbShowerP *shower)
 
 ClassDef (EdbShowAlg, 1)
 
Double_t DeltaR_NoPropagation (EdbSegP *s, EdbSegP *stest)
 
Double_t DeltaR_WithoutPropagation (EdbSegP *s, EdbSegP *stest)
 
Double_t DeltaR_WithPropagation (EdbSegP *s, EdbSegP *stest)
 
Double_t DeltaTheta (EdbSegP *s1, EdbSegP *s2)
 
Double_t DeltaThetaComponentwise (EdbSegP *s1, EdbSegP *s2)
 
Double_t DeltaThetaSingleAngles (EdbSegP *s1, EdbSegP *s2)
 
 EdbShowAlg ()
 
 EdbShowAlg (TString AlgName, Int_t AlgValue)
 
TString GetAlgName () const
 
Int_t GetAlgValue () const
 
Double_t GetMinimumDist (EdbSegP *seg1, EdbSegP *seg2)
 
TObjArray * GetRecoShowerArray () const
 
Int_t GetRecoShowerArrayN () const
 
EdbShowerPGetShower (Int_t i) const
 
Double_t GetSpatialDist (EdbSegP *s1, EdbSegP *s2)
 
void Help ()
 
Bool_t IsInConeTube (EdbSegP *sTest, EdbSegP *sStart, Double_t CylinderRadius, Double_t ConeAngle)
 
void Print ()
 
void PrintAll ()
 
void PrintMore ()
 
void PrintParameters ()
 
void PrintParametersShort ()
 
void SetActualAlgParameterset (Int_t ActualAlgParametersetNr)
 
void SetEdbPVRec (EdbPVRec *Ali)
 
void SetEdbPVRecPIDNumbers (Int_t FirstPlate_eAliPID, Int_t LastPlate_eAliPID, Int_t MiddlePlate_eAliPID, Int_t NumberPlate_eAliPID)
 
void SetInBTArray (TObjArray *InBTArray)
 
void SetParameter (Int_t parNr, Float_t par)
 
void SetParameters (Float_t *par)
 
void SetRecoShowerArray (TObjArray *RecoShowerArray)
 
void SetRecoShowerArrayN (Int_t RecoShowerArrayN)
 
void SetUseAliSub (Bool_t UseAliSub)
 
void Transform_eAli (EdbSegP *InitiatorBT, Float_t ExtractSize)
 
void UpdateShowerIDs ()
 
void UpdateShowerMetaData ()
 
virtual ~EdbShowAlg ()
 

Additional Inherited Members

- Protected Member Functions inherited from EdbShowAlg
void Set0 ()
 
- Protected Attributes inherited from EdbShowAlg
Int_t eActualAlgParametersetNr
 
TString eAlgName
 
Int_t eAlgValue
 
EdbPVReceAli
 
EdbPVReceAli_Sub
 
Int_t eAli_SubNpat
 
Int_t eAliNpat
 
Int_t eFirstPlate_eAliPID
 
TObjArray * eInBTArray
 
Int_t eInBTArrayN
 
Int_t eLastPlate_eAliPID
 
Int_t eMiddlePlate_eAliPID
 
Int_t eNumberPlate_eAliPID
 
Int_t eParaN
 
TString eParaString [10]
 
Float_t eParaValue [10]
 
EdbShowerPeRecoShower
 
TObjArray * eRecoShowerArray
 
Int_t eRecoShowerArrayN
 
Int_t eUseAliSub
 

Constructor & Destructor Documentation

◆ EdbShowAlg_SA()

EdbShowAlg_SA::EdbShowAlg_SA ( )
569 {
570 // Default Constructor
571  cout << "EdbShowAlg_SA::EdbShowAlg_SA() Default Constructor SA stands for ?????? To be filled..."<<endl;
572 
573 // Reset all:
574  Set0();
575 
576  eAlgName="SA";
577  eAlgValue=5; // see default.par_SHOWREC for labeling (labling identical with ShowRec program)
578  eParaN =2; // depends on the algorithm, how much parameters it has got.
579 
580 // Set the two Cuts and their names:
581  Init();
582 }
void Init()
Definition: EdbShowAlg.cxx:595
TString eAlgName
Definition: EdbShowAlg.h:49
void Set0()
Definition: EdbShowAlg.cxx:53
Int_t eAlgValue
Definition: EdbShowAlg.h:50
Int_t eParaN
Definition: EdbShowAlg.h:51

◆ ~EdbShowAlg_SA()

EdbShowAlg_SA::~EdbShowAlg_SA ( )
virtual
587 {
588  cout << "EdbShowAlg_SA::~EdbShowAlg_SA()"<<endl;
589 // Default Destructor
590 }

Member Function Documentation

◆ ClassDef()

EdbShowAlg_SA::ClassDef ( EdbShowAlg_SA  ,
 
)

◆ Execute()

void EdbShowAlg_SA::Execute ( )
virtual

Reimplemented from EdbShowAlg.

623 {
624  cout << "EdbShowAlg_SA::Execute()" << endl;
625  cout << "EdbShowAlg_SA::Execute DOING MAIN SHOWER RECONSTRUCTION HERE" << endl;
626 
627  EdbSegP* InBT;
628  EdbSegP* Segment;
629  EdbShowerP* RecoShower;
630 
631  Bool_t StillToLoop=kTRUE;
632  Int_t ActualPID;
633  Int_t newActualPID;
634  Int_t STEP=-1;
635  Int_t NLoopedPattern=0;
637  if (gEDBDEBUGLEVEL>3) cout << "EdbShowAlg_SA::Execute--- STEP for patternloop direction = " << STEP << endl;
638 
639 //--- Loop over InBTs:
640 
641 // Since eInBTArray is filled in ascending ordering by zpositon
642 // We use the descending loop to begin with BT with lowest z first.
643  for (Int_t i=eInBTArrayN-1; i>=0; --i) {
644 
645 // CounterOutPut
646  if (gEDBDEBUGLEVEL==2) if ((i%100)==0) cout << eInBTArrayN <<" InBT in total, still to do:"<<Form("%4d",i)<< "\r\r\r\r"<<flush;
647 
648 //-----------------------------------
649 // 1) Make local_gAli with cut parameters:
650 //-----------------------------------
651 
652 // Create new EdbShowerP Object for storage;
653 // See EdbShowerP why I have to call the Constructor as "unique" ideficable value
654  RecoShower = new EdbShowerP(i,eAlgValue,eActualAlgParametersetNr);
655 
656 // Get InitiatorBT from eInBTArray
657  InBT=(EdbSegP*)eInBTArray->At(i);
658  if (gEDBDEBUGLEVEL>2) InBT->PrintNice();
659 
660 // Add InBT to RecoShower:
661 // This has to be done, since by definition the first BT in the RecoShower is the InBT.
662 // Otherwise, also the definition of shower axis and transversal profiles is wrong!
663  RecoShower -> AddSegment(InBT);
664  if (gEDBDEBUGLEVEL>4) cout << "Segment (InBT) " << Segment << " was added to RecoShower." << endl;
665 
666 // Transform (make size smaller, extract only events having same MC) the eAli object:
667 // See in Execute_CA for description.
668  Transform_eAli(InBT,eParaValue[1]); // here with ExtractSize set!
669 
670 // Add InBT to RecoShower // obsolete, since we loop also over the plate containing the InBT
671 //RecoShower --> AddSegment(InBT);
672 
673 //-----------------------------------
674 // 2) Loop over (whole) eAli, check BT for Cuts
675 //-----------------------------------
676  ActualPID= InBT->PID() ;
677  newActualPID= InBT->PID() ;
678 
679  while (StillToLoop) {
680  if (gEDBDEBUGLEVEL>3) cout << "EdbShowAlg_SA::Execute--- --- Doing patterloop " << ActualPID << endl;
681 
682  for (Int_t btloop_cnt=0; btloop_cnt<eAli->GetPattern(ActualPID)->GetN(); ++btloop_cnt) {
683 
684  Segment = (EdbSegP*)eAli->GetPattern(ActualPID)->GetSegment(btloop_cnt);
685  if (gEDBDEBUGLEVEL>4) Segment->PrintNice();
686 
687 // Now apply cut conditions: SA Simple Alg --------------------
688 // ___ TO FILL IN HERE ___
689  if (Segment->MCEvt()!=InBT->MCEvt()) continue;
690  if (Segment->P()<eParaValue[0]) continue;
691 // end of cut conditions: SA Simple Alg --------------------
692 
693 // If we arrive here, Basetrack Segment has passed criteria
694 // and is then added to the RecoShower:
695 // Check if its not the InBT which is already added:
696  if (Segment->X()==InBT->X()&&Segment->Y()==InBT->Y()) {
697  ; // is InBT, do nothing;
698  }
699  else {
700  RecoShower -> AddSegment(Segment);
701  }
702  if (gEDBDEBUGLEVEL>4) cout << "Segment " << Segment << " was added at &Segment : " << &Segment << endl;
703 
704  } // of btloop_cnt
705 
706 //------------
707  newActualPID=ActualPID+STEP;
708  ++NLoopedPattern;
709 
710  if (gEDBDEBUGLEVEL>3) cout << "EdbShowAlg_SA::Execute--- --- newActualPID= " << newActualPID << endl;
711  if (gEDBDEBUGLEVEL>3) cout << "EdbShowAlg_SA::Execute--- --- NLoopedPattern= " << NLoopedPattern << endl;
712  if (gEDBDEBUGLEVEL>3) cout << "EdbShowAlg_SA::Execute--- --- eNumberPlate_eAliPID= " << eNumberPlate_eAliPID << endl;
713  if (gEDBDEBUGLEVEL>3) cout << "EdbShowAlg_SA::Execute--- --- StillToLoop= " << StillToLoop << endl;
714 
715 // This if holds in the case of STEP== +1
716  if (STEP==1) {
717  if (newActualPID>eLastPlate_eAliPID) StillToLoop=kFALSE;
718  if (newActualPID>eLastPlate_eAliPID) cout << "EdbShowAlg_SA::Execute--- ---Stop Loop since: newActualPID>eLastPlate_eAliPID"<<endl;
719  }
720 // This if holds in the case of STEP== -1
721  if (STEP==-1) {
722  if (newActualPID<eLastPlate_eAliPID) StillToLoop=kFALSE;
723  if (newActualPID<eLastPlate_eAliPID && gEDBDEBUGLEVEL>3) cout << "EdbShowAlg_SA::Execute--- ---Stop Loop since: newActualPID<eLastPlate_eAliPID"<<endl;
724  }
725 // This if holds general, since eNumberPlate_eAliPID is not dependent of the structure of the gAli subject:
726  if (NLoopedPattern>eNumberPlate_eAliPID) StillToLoop=kFALSE;
727  if (NLoopedPattern>eNumberPlate_eAliPID && gEDBDEBUGLEVEL>3) cout << "EdbShowAlg_SA::Execute--- ---Stop Loop since: NLoopedPattern>eNumberPlate_eAliPID"<<endl;
728 
729  ActualPID=newActualPID;
730  } // of // while (StillToLoop)
731 
732 // Obligatory when Shower Reconstruction is finished!
733  RecoShower ->Update();
734 //RecoShower ->PrintBasics();
735 
736 
737 // if (gEDBDEBUGLEVEL>3) cout << "EdbShowAlg_SA::Execute--- Before adding to array delete the histograms...by finalize() of shower."<<endl;
738 // RecoShower ->Finalize();
739 // if (gEDBDEBUGLEVEL>3) cout << "EdbShowAlg_SA::Execute--- Finalize done..."<<endl;
740 
741 
742 // Add Shower Object to Shower Reco Array.
743 // Not, if its empty:
744 // Not, if its containing only one BT:
745  if (RecoShower->N()>1) {
746  AddRecoShowerArray(RecoShower);
747  }
748  else {
749  // Delete the created shower object. Saves _lots_ of memory and speeds up reconstruction for large #InBTs!
750  // TODO Also Include this in the other RecoAlgs ...
751  Log(3,"EdbShowAlg_SA::Execute()","InBT # %d RecoShower->N()<=1: Dont add shower to RecoShowerArray. Delete this shower for memory safing.");
752  delete RecoShower;
753  RecoShower=NULL;
754  }
755 
756 // Set back loop values:
757  StillToLoop=kTRUE;
758  NLoopedPattern=0;
759  } // of // for (Int_t i=eInBTArrayN-1; i>=0; --i) {
760 
761 
762 // Set new value for eRecoShowerArrayN (may now be < eInBTArrayN).
763  SetRecoShowerArrayN(eRecoShowerArray->GetEntries());
764 
765  cout << "EdbShowAlg_SA::eRecoShowerArray() Entries: " << eRecoShowerArray->GetEntries() << endl;
766  cout << "EdbShowAlg_SA::Execute()...done." << endl;
767  return;
768 }
bool Log(int level, const char *location, const char *fmt,...)
Definition: EdbLog.cxx:75
EdbPattern * GetPattern(int id) const
Definition: EdbPattern.cxx:1887
Definition: EdbSegP.h:18
Float_t X() const
Definition: EdbSegP.h:170
Float_t P() const
Definition: EdbSegP.h:149
Float_t Y() const
Definition: EdbSegP.h:171
void PrintNice() const
Definition: EdbSegP.cxx:418
Int_t PID() const
Definition: EdbSegP.h:145
Int_t MCEvt() const
Definition: EdbSegP.h:142
EdbSegP * GetSegment(int i) const
Definition: EdbPattern.h:66
void Transform_eAli(EdbSegP *InitiatorBT, Float_t ExtractSize)
Definition: EdbShowAlg.cxx:107
Float_t eParaValue[10]
Definition: EdbShowAlg.h:52
void AddRecoShowerArray(EdbShowerP *shower)
Definition: EdbShowAlg.h:120
void SetRecoShowerArrayN(Int_t RecoShowerArrayN)
Definition: EdbShowAlg.h:117
TObjArray * eRecoShowerArray
Definition: EdbShowAlg.h:70
Int_t eFirstPlate_eAliPID
Definition: EdbShowAlg.h:65
Int_t eLastPlate_eAliPID
Definition: EdbShowAlg.h:66
Int_t eInBTArrayN
Definition: EdbShowAlg.h:63
TObjArray * eInBTArray
Definition: EdbShowAlg.h:62
EdbPVRec * eAli
Definition: EdbShowAlg.h:59
Int_t eNumberPlate_eAliPID
Definition: EdbShowAlg.h:68
Int_t eActualAlgParametersetNr
Definition: EdbShowAlg.h:54
Definition: EdbShowerP.h:28
Int_t N() const
Definition: EdbShowerP.h:412
void Update()
Definition: EdbShowerP.cxx:975
gEDBDEBUGLEVEL
Definition: energy.C:7
#define NULL
Definition: nidaqmx.h:84

◆ Finalize()

void EdbShowAlg_SA::Finalize ( )
virtual

Reimplemented from EdbShowAlg.

774 {
775  cout << "EdbShowAlg_SA::Finalize()" << endl;
776  return;
777 }

◆ Init()

void EdbShowAlg_SA::Init ( void  )
596 {
597  Log(2,"EdbShowAlg_SA::EdbShowAlg_SA","Init()");
598 
599 // Init with values according to ?? Alg:
600 
601 // threshold cut on s->P()
602  eParaValue[0]=0;
603  eParaString[0]="MINIMUM_P";
604 
605 // size cut on the eAliSub to choose
606  eParaValue[1]=1000;
607  eParaString[1]="EXTRACTIONSIZE";
608 
609  return;
610 }
TString eParaString[10]
Definition: EdbShowAlg.h:53

◆ Initialize()

void EdbShowAlg_SA::Initialize ( )
virtual

Reimplemented from EdbShowAlg.

616 {
617  cout << "EdbShowAlg_SA::Initialize()" << endl;
618  return;
619 }

The documentation for this class was generated from the following files: