HighLAND
Public Member Functions | Protected Attributes | List of all members
oaAnalysisTreeConverter Class Reference
Inheritance diagram for oaAnalysisTreeConverter:
InputConverter

Public Member Functions

virtual bool Initialize ()
 
virtual void SetCosmicMode (const bool cosmic)
 
virtual Int_t GetSpill (Long64_t &entry, AnaSpillC *&spill)
 
Int_t GetEvent (Long64_t &entry, AnaEventC *&event)
 
void IncrementPOTBySpill ()
 
virtual Int_t ReadEntries (Long64_t &entry)
 
virtual bool AddFileToTChain (const std::string &inputString)
 Add the file specified to fChain, and any friend chains that were set up.
 
virtual AnaSpillBMakeSpill ()
 
virtual AnaBunchBMakeBunch ()
 
virtual AnaBeamBMakeBeam ()
 
virtual AnaDataQualityBMakeDataQuality ()
 
virtual AnaEventInfoBMakeEventInfo ()
 
virtual AnaTriggerMakeTrigger ()
 
virtual AnaVertexBMakeVertex ()
 
virtual AnaTrueParticleBMakeTrueParticle ()
 
virtual AnaTrueVertexBMakeTrueVertex ()
 
virtual AnaTrackBMakeTrack ()
 
virtual AnaTPCParticleBMakeTpcTrack ()
 
virtual AnaTrackerTrackBMakeTrackerTrack ()
 
virtual AnaFGDParticleBMakeFgdTrack ()
 
virtual AnaP0DParticleBMakeP0dTrack ()
 
virtual AnaECALParticleBMakeEcalTrack ()
 
virtual AnaSMRDParticleBMakeSmrdTrack ()
 
virtual AnaFgdTimeBinBMakeFgdTimeBin ()
 
virtual AnaTECALReconObjectMakeTECALReconObject ()
 
virtual AnaTECALUnmatchedObjectMakeTECALUnmatchedObject ()
 
virtual AnaP0DReconVertexMakeP0DReconVertex ()
 
virtual AnaP0DReconParticleMakeP0DReconParticle ()
 
virtual AnaP0DReconClusterMakeP0DReconCluster ()
 
virtual AnaBunchMakeLocalReconBunch ()
 
virtual void GetBunchLocalP0DObjects ()
 
virtual void GetBunchLocalP0DObjectsInAlgoResult (Int_t iAlgoRes)
 
virtual void FillP0DBunch (AnaBunchB *bunch, int ibunch, Int_t iAlgoRes)
 
virtual void FillP0DVertices (const std::vector< Int_t > &indices, AnaP0DBunch *bunch)
 
virtual void FillP0DParticles (const std::vector< Int_t > &indices, AnaP0DBunch *bunch)
 
virtual void FillP0DParticlesFromTracks (const std::vector< Int_t > &indices, AnaP0DBunch *bunch)
 
virtual void FillP0DParticlesFromShowers (const std::vector< Int_t > &indices, AnaP0DBunch *bunch)
 
virtual void FillP0DClusters (const std::vector< Int_t > &indices, AnaP0DBunch *bunch)
 
ND::TP0DReconModule::TP0DParticle * GetP0DReconParticleWithUniqueID (UInt_t uniqueID)
 
void AddReconVertexToReconParticle (AnaVertexB *vertex, AnaTrack *part)
 
void FillDelayedClustersInfo (AnaSpill &spill)
 
AnaP0DVertexGetAnaP0DVertex (Int_t index)
 
AnaP0DClusterGetAnaP0DCluster (Int_t index)
 
AnaP0DParticleGetAnaP0DParticle (Int_t index)
 
AnaP0DParticleGetAnaP0DParticleFromTrack (Int_t index)
 
AnaP0DParticleGetAnaP0DParticleFromShower (Int_t index)
 
virtual AnaP0DVertexMakeP0DVertex ()
 
virtual AnaP0DParticleMakeP0DParticle ()
 
virtual AnaP0DClusterMakeP0DCluster ()
 
virtual AnaP0DHitMakeP0DHit ()
 
virtual AnaP0DBunchMakeP0DBunch ()
 
virtual void FillInfo (AnaSpill *spill)
 
virtual void FillBunchInfo (AnaSpill *spill)
 
virtual void FillPIDs (AnaBunch *bunch, int ibunch)
 
virtual void FillTECALReconObjects (AnaBunch *bunch, int ibunch)
 
virtual void FillTECALReconUnmatchedObjects (AnaBunch *bunch, int ibunch)
 
virtual void FillP0DReconVertices (AnaBunch *bunch, int ibunch)
 
virtual void FillP0DReconParticles (AnaBunch *bunch, int ibunch)
 
virtual void FillP0DReconClusters (AnaBunch *bunch, int ibunch)
 
virtual void FillGlobalVertices (AnaSpill *spill)
 
virtual void DeleteBadObjects (AnaSpill *spill)
 
virtual void DeleteTrueParticle (AnaSpill *spill, AnaTrueParticleB *trackToDelete)
 
virtual void DeleteRecoParticle (AnaSpill *spill, AnaParticleB *particleToDelete)
 
virtual void DeleteRecoVertex (AnaSpill *spill, AnaVertexB *vertexToDelete)
 
virtual void FillTrackInfo (ND::TGlobalReconModule::TGlobalPID &PID, AnaTrack *track)
 
virtual void FillVertexInfo (ND::TGlobalReconModule::TGlobalVertex &global_vertex, AnaVertex *vertex, AnaBunch *bunch, AnaSpill *spill)
 
virtual AnaTrackFindTrack (const int UniqueID, AnaBunch *bunch, AnaSpill *spill)
 
virtual void FillTrueVerticesMatchInfo (ND::TTrueVertex *matchedTrueVertex, AnaVertex *vertex, AnaBunch *bunch)
 
virtual AnaRecTrueMatchFillCompletenessCleanliness (AnaVertex *vertex, AnaBunch *bunch, AnaTrueVertexB *truevertex)
 
virtual void FillTrueParticleRecoInfo (ND::TTrueParticle &trueParticle, AnaTrueObjectC *&trueObj, bool setpurity)
 
virtual void FillTrueParticleInfo (ND::TTruthTrajectoriesModule::TTruthTrajectory *truthTraj, AnaTrueParticle *truePart, AnaSpill *spill)
 
virtual void FillTrackHits (ND::TGlobalReconModule::TGlobalPID &PID, AnaTrack *track)
 
virtual void FillTpcInfo (ND::TGlobalReconModule::TGlobalPID &PID, AnaTrack *track)
 
virtual void FillTrackerInfo (ND::TGlobalReconModule::TGlobalPID &PID, AnaTrack *track)
 
virtual void FillFgdInfo (ND::TGlobalReconModule::TGlobalPID &PID, AnaTrack *track)
 
virtual void FillEcalInfo (ND::TGlobalReconModule::TGlobalPID &PID, AnaTrack *track)
 
virtual void FillSmrdInfo (ND::TGlobalReconModule::TGlobalPID &PID, AnaTrack *track)
 
virtual void FillP0dInfo (ND::TGlobalReconModule::TGlobalPID &PID, AnaTrack *track)
 
virtual void FillTpcTrackInfo (ND::TGlobalReconModule::TTPCObject &tpcTrack, AnaTPCParticle *seg)
 
virtual void FillTrackerTrackInfo (ND::TGlobalReconModule::TTrackerObject &trTrack, AnaTrackerTrack *seg)
 
virtual void FillFgdTrackInfo (ND::TGlobalReconModule::TFGDObject &fgdTrack, AnaFGDParticle *seg)
 
virtual void FillEcalTrackInfo (ND::TGlobalReconModule::TECALObject &ecalTrack, AnaECALParticle *seg)
 
virtual void FillSmrdTrackInfo (ND::TGlobalReconModule::TSMRDObject &smrdTrack, AnaSMRDParticle *seg)
 
virtual void FillP0dTrackInfo (ND::TGlobalReconModule::TP0DObject &p0dTrack, AnaP0DParticle *seg)
 
virtual void FillSubdetectorTrackInfo (ND::TSubBaseObject &subTrack, AnaParticleB *seg)
 
virtual void FillTrueInfo (AnaSpill *spill)
 
virtual bool FillTrueVertexInfo (ND::TTruthVerticesModule::TTruthVertex *true_vertex, AnaTrueVertex *vertex, int v, AnaSpill *spill)
 
virtual void FillFgdTimeBinInfo (std::vector< AnaFgdTimeBinB *> *AnaFgdTimeBins)
 
virtual void FillBeamInfo (bool isMC, AnaBeam *beam)
 
virtual void FillTriggerInfo (AnaTrigger *trigger)
 
virtual void FillDQInfo (AnaDataQuality *dq)
 
virtual void FillTECALReconObjectInfo (ND::TTrackerECALReconModule::TECALReconObject &tecalReconObject, AnaTECALReconObject *anaTECALReconObject, AnaLocalReconBunch *anaLocalBunch)
 
virtual void FillTECALUnmatchedObjectInfo (ND::TTrackerECALReconModule::TECALReconUnmatchedObject &tecalUnmatchedObject, AnaTECALUnmatchedObject *anaTECALUnmatchedObject, AnaLocalReconBunch *anaLocalBunch)
 
virtual void FillP0DReconVertexInfo (ND::TP0DReconModule::TP0DVertex &p0dVertex, AnaP0DReconVertex *anaP0DReconVertex, AnaLocalReconBunch *anaLocalBunch)
 
virtual void FillP0DReconParticleInfo (ND::TP0DReconModule::TP0DParticle &p0dParticle, AnaP0DReconParticle *anaP0DReconParticle, AnaLocalReconBunch *anaLocalBunch)
 
virtual void FillP0DReconClusterInfo (ND::TP0DReconModule::TP0DCluster &p0dCluster, AnaP0DReconCluster *anaP0DReconCluster, AnaLocalReconBunch *anaLocalBunch)
 
virtual void FillP0DReconVertexLinks (ND::TP0DReconModule::TP0DVertex &p0dVertex, AnaP0DReconVertex *anaP0DReconVertex)
 
virtual void FillP0DReconParticleLinks (ND::TP0DReconModule::TP0DParticle &p0dParticle, AnaP0DReconParticle *anaP0DReconParticle)
 
virtual void FillP0DReconClusterLinks (ND::TP0DReconModule::TP0DCluster &p0dCluster, AnaP0DReconCluster *anaP0DReconCluster)
 
virtual void FillP0DVertexInfo (ND::TP0DReconModule::TP0DVertex &p0dVertex, AnaP0DVertex *anaP0DVertex, AnaBunchB *bunch)
 
virtual void FillP0DParticleInfo (ND::TP0DReconModule::TP0DParticle &p0dParticle, AnaP0DParticle *anaP0DParticle)
 
virtual void FillP0DParticleInfo (ND::TP0DReconModule::TP0DTrack &p0dTrack, AnaP0DParticle *anaP0DParticle)
 
virtual void FillP0DParticleInfo (ND::TP0DReconModule::TP0DShower &p0dShower, AnaP0DParticle *anaP0DParticle)
 
virtual void FillP0DClusterInfo (ND::TP0DReconModule::TP0DCluster &p0dCluster, AnaP0DCluster *anaP0DCluster)
 
virtual void FillP0DClusterInfo (ND::TP0DReconModule::TP0DNode &p0dNode, AnaP0DCluster *anaP0DCluster)
 
virtual void FillP0DHitInfo (ND::TP0DReconModule::TP0DHit &p0dHit, AnaP0DHit *anaP0DHit)
 
virtual void GetBunchPIDs ()
 
virtual void GetBunchVertices ()
 
virtual void GetBunchLocalObjects ()
 
virtual double GetVertexTime (ND::TGlobalReconModule::TGlobalPID &globalTrack)
 
virtual int GetGenieReactionCode (const std::string &reactionCode)
 
Double_t GetPOTFromRooTrackerVtx ()
 
bool HasNonContainedReconParticles (AnaTrueParticleB *trueTrack)
 
bool IsFullyContained (const AnaTrueVertexB &trueVertex)
 
Int_t GetNVtx ()
 
TClonesArray * GetVtx ()
 
- Public Member Functions inherited from InputConverter
 InputConverter (const std::string &name)
 Constrctor provided a name.
 
virtual ~InputConverter ()
 Everyone should have a destructor...
 
const std::string & GetTreeName ()
 returns the name of the tree to convert
 
const std::string & Name () const
 Return the name of this converter.
 
void SetName (const std::string &name)
 Set the name of this converter, which is used internally by the InputManager.
 
virtual void Reset ()
 Reset the trees in the TChain and the number of entries. Also the header (POT, etc)
 
virtual Long64_t LoadTree (Long64_t entry)
 Handle loading the correct entry from fChain.
 
virtual Long64_t GetEntries ()
 Return the total number of entries in the chain.
 
virtual Int_t GetNEvents (Int_t entries=-1)
 Return the total number of events for a given number of entries in the tree.
 
virtual bool IsCorrectType (const std::string &inputString)
 Whether the implementation can handle the specified file.
 
bool HasChain (const std::string &name)
 
void AddChain (const std::string &name, const std::string &name_path="")
 
TChain * GetChain (const std::string &name="")
 
Headerheader ()
 Returns the Header manager.
 

Protected Attributes

std::vector< ND::TGlobalReconModule::TGlobalPID * > _bunchPIDs [NBUNCHES+1]
 
std::vector< ND::TGlobalReconModule::TGlobalVertex * > _bunchVertices [NBUNCHES+1]
 
std::vector< ND::TP0DReconModule::TP0DVertex * > _bunchP0DVertices [NBUNCHES+1]
 
std::vector< ND::TP0DReconModule::TP0DParticle * > _bunchP0DParticles [NBUNCHES+1]
 
std::vector< ND::TP0DReconModule::TP0DCluster * > _bunchP0DClusters [NBUNCHES+1]
 
std::vector< ND::TTrackerECALReconModule::TECALReconObject * > _bunchTECALObjects [NBUNCHES+1]
 
std::vector< ND::TTrackerECALReconModule::TECALReconUnmatchedObject * > _bunchTECALUnmatchedObjects [NBUNCHES+1]
 
std::map< ND::TP0DReconModule::TP0DVertex *, AnaP0DReconVertex * > _P0DReconVerticesMap
 
std::map< ND::TP0DReconModule::TP0DParticle *, AnaP0DReconParticle * > _P0DReconParticlesMap
 
std::map< ND::TP0DReconModule::TP0DCluster *, AnaP0DReconCluster * > _P0DReconClustersMap
 
std::vector< Int_t > _bunchP0DVerticesInAlgoRes [NBUNCHES+1][NMAXP0DALGORES]
 
std::vector< Int_t > _bunchP0DClustersInAlgoRes [NBUNCHES+1][NMAXP0DALGORES]
 
std::vector< Int_t > _bunchP0DParticlesInAlgoRes [NBUNCHES+1][NMAXP0DALGORES]
 
std::vector< Int_t > _bunchP0DTracksInAlgoRes [NBUNCHES+1][NMAXP0DALGORES]
 
std::vector< Int_t > _bunchP0DShowersInAlgoRes [NBUNCHES+1][NMAXP0DALGORES]
 
std::vector< AnaP0DVertex * > _AnaP0DVertices
 
std::vector< AnaP0DParticle * > _AnaP0DParticles
 
std::vector< AnaP0DParticle * > _AnaP0DTracks
 
std::vector< AnaP0DParticle * > _AnaP0DShowers
 
std::vector< AnaP0DCluster * > _AnaP0DClusters
 
bool _firstFile
 
bool _firstEntry
 
Int_t _RooVtxEntryInCurrentInputFile
 
TTruthUtils _truthUtils
 
AnaSpill_spill
 
ND280BeamBunching _bunching
 
std::string _previousFile
 
Int_t _previousRunID
 
Int_t _previousSubrunID
 
Int_t _previousRefEventID
 
TChain * reconGlobal
 
TChain * trackerECAL
 
TChain * p0d
 
TChain * fgdOnly
 
TChain * mcTruthVertices
 
TChain * mcTruthTrajectories
 
TChain * GRooTrackerVTX
 
TChain * NRooTrackerVTX
 
TChain * beamInfo
 
TChain * accPOTInfo
 
TChain * BasicHeader
 
TChain * DQInfo
 
Int_t Entries
 
Int_t Counter
 
bool Genie
 
bool Neut
 
bool GenieFirstFile
 
bool NeutFirstFile
 
bool AccPOTflg
 
Int_t EventID
 
Int_t RunID
 
Int_t SubrunID
 
Bool_t IsMC
 
Int_t Preselected
 
Int_t EventTime
 
Int_t TriggerWord
 
Bool_t FGDCosmicEvent
 
Bool_t TripTCosmicEvent
 
Bool_t P0DWaterStatus
 
Char_t SoftwareVersion [50]
 
Float_t POTPerSpill
 
Int_t NTrECalObjects
 
TClonesArray * TrECalObjects
 
Int_t NTrECalUnmatched
 
TClonesArray * TrECalUnmatched
 
Short_t NP0DAlgoResults
 
TClonesArray * P0DAlgoResults
 
Short_t NP0DReconVertices
 
TClonesArray * P0DReconVertices
 
Short_t NP0DReconParticles
 
TClonesArray * P0DReconParticles
 
Short_t NP0DReconTracks
 
TClonesArray * P0DReconTracks
 
Short_t NP0DReconShowers
 
TClonesArray * P0DReconShowers
 
Short_t NP0DReconClusters
 
TClonesArray * P0DReconClusters
 
Short_t NP0DReconNodes
 
TClonesArray * P0DReconNodes
 
Short_t NP0DReconHits
 
TClonesArray * P0DReconHits
 
Int_t NPIDs
 
TClonesArray * PIDs
 
Int_t NVertices
 
TClonesArray * Vertices
 
Int_t NFGD1Unused
 
Int_t NFGD2Unused
 
Int_t NP0DUnused
 
Int_t NTPCUnused
 
Int_t NDelayedClusters
 
TClonesArray * DelayedClusters
 
Int_t NTPCOthers
 
TClonesArray * TPCOthers
 
Int_t NFgdTimeBins
 
TClonesArray * FgdTimeBins
 
Int_t NTruthVertices
 
Int_t NVtxFGD1
 
Int_t NVtxFGD2
 
TClonesArray * TruthVertices
 
std::string TruthVerticesName [9]
 
Int_t NTruthTrajs
 
TClonesArray * TruthTrajs
 
std::string TruthTrajsName [7]
 
Int_t NGVtx
 
TClonesArray * GVtx
 
Int_t NNVtx
 
TClonesArray * NVtx
 
Int_t NXZTracks_Radon2
 
Int_t NYZTracks_Radon2
 
Int_t NXYZTracks_Radon2
 
Int_t NXZTracksAllFGD_Radon2
 
Int_t NYZTracksAllFGD_Radon2
 
Int_t NXYZTracksAllFGD_Radon2
 
TClonesArray * XZTracks_Radon2
 
TClonesArray * YZTracks_Radon2
 
TClonesArray * XYZTracks_Radon2
 
TClonesArray * XZTracksAllFGD_Radon2
 
TClonesArray * YZTracksAllFGD_Radon2
 
TClonesArray * XYZTracksAllFGD_Radon2
 
TClonesArray * VtxP0DECal
 
TClonesArray * beamSummary
 
int beamSummaryDataStatus
 
Int_t ND280Spill
 
Int_t fBarECALFlag
 
Int_t fDSECALFlag
 
Int_t fECALFlag
 
Int_t fFGD1Flag
 
Int_t fFGD2Flag
 
Int_t fFGDFlag
 
Int_t fINGRIDFlag
 
Int_t fMAGNETFlag
 
Int_t fND280OffFlag
 
Int_t fP0DECALFlag
 
Int_t fP0DFlag
 
Int_t fSMRDFlag
 
Int_t fTPC1Flag
 
Int_t fTPC2Flag
 
Int_t fTPC3Flag
 
Int_t fTPCFlag
 
bool cosmic_mode
 Whether we're running in "cosmic" mode, where there is only one bunch.
 
ecalPid::TECALPidLikelihood * _ecalPidCalc
 To calculate the ECal PID likelihood variables.
 
bool _isUsingReconDirFGDOnly
 Use local reconstruction information?
 
bool _isUsingReconDirP0D
 
bool _isUsingReconDirPECAL
 
bool _isUsingReconDirTECAL
 
bool _isUsingReconDirP0DNew
 
std::string _p0dAlgoResName
 
Int_t _topP0DAlgoRes
 
bool _addGlobalTracksToP0DVertices
 
bool _ignoreSMRDContainedTrueObjects
 ignore some true objects when there are fully contained in the specified subdetectors
 
bool _ignoreP0DECalContainedTrueObjects
 
bool _ignoreBrECalContainedTrueObjects
 
bool _ignoreDsECalContainedTrueObjects
 
bool _ignoreINGRIDContainedTrueObjects
 
bool _removeTrueVerticesWithNoTrueParticles
 Remove uninteresting vertices.
 
std::vector< AnaTrueParticleB * > _containedTrueParticles
 
bool _foundPauliBlocked
 
bool _foundCohOnH
 
bool _alreadyWarned
 
- Protected Attributes inherited from InputConverter
std::string _name
 The name of the converter.
 
std::string _treeName
 The name of the tree to convert.
 
int _nentries
 The number of entries in the chain. To be set by the implementation.
 
TChain * fChain
 The main TChain used to read events from the input file.
 
Int_t fCurrent
 current Tree number in a TChain
 
Int_t _currentFileIndex
 
std::string _currentFileName
 
std::map< std::string, TChain * > _chain_map
 
Header _header
 The header manager.
 

Detailed Description

Definition at line 39 of file oaAnalysisTreeConverter.hxx.

Member Function Documentation

§ GetEvent()

Int_t oaAnalysisTreeConverter::GetEvent ( Long64_t &  entry,
AnaEventC *&  event 
)
inlinevirtual

Read the specified entry from the file, and fill the event. The entry number must be incremented inside this function 0 should be returned on error.

Implements InputConverter.

Definition at line 49 of file oaAnalysisTreeConverter.hxx.

49 {(void)entry;(void)event; return 0;}

§ GetSpill()

Int_t oaAnalysisTreeConverter::GetSpill ( Long64_t &  entry,
AnaSpillC *&  spill 
)
virtual

Read the specified entry from the file, and fill the spill. The entry number must be incremented as part of this function, and the new entry number returned. 0 should be returned on error.

Implements InputConverter.

Definition at line 720 of file oaAnalysisTreeConverter.cxx.

720  {
721 //*****************************************************************************
722 
723  // Read contents of entry (which correspond to one Spill)
724  if (!fChain) return 0;
725 
726  std::string filename(reconGlobal->GetFile()->GetName());
727 
728  if( filename != _currentFileName ) {
729  _currentFileIndex++;
730  _RooVtxEntryInCurrentInputFile=0;
731  std::cout << " Running on file (" << _currentFileIndex << "): " << filename << std::endl;
732  _currentFileName = filename;
733  _alreadyWarned=false;
734 
735  //load geometry
736  ND::hgman().LoadGeometry(filename);
737  }
738 
739  Int_t entry_temp = ReadEntries(entry);
740 
741  // If this is not one of the events to skim just go to the next entry (and don't process that event --> return <=0)
742  if (!anaUtils::CheckSkimmedEvent(RunID,SubrunID,EventID)){
743  entry++;
744  return 0;
745  }
746 
747  // Protection against empty spills. For those spills do not create a AnaSpill in the InputManager
748  if (((Neut && NNVtx==0) || (Genie && NGVtx==0) || EventID<0) && !FGDCosmicEvent && !TripTCosmicEvent){
749  entry_temp=0;
750  // too many of these warnings for antinu, see bugzilla 1133
751  // TODO: count them and dump the final number at the end
752 // std::cout << "INFO: NVtx=0 in RooTrackerVtx (no vertices, i.e. empty spill) for event " << RunID << "-" << EventID << " --> Skip it" << std::endl;
753  }
754  else{
755  if (entry_temp > 0) {
756 
757  // Create an instance of the Spill
758  spill = MakeSpill();
759 
760  // Cast it to AnaSpill
761  _spill = static_cast<AnaSpill*>(spill);
762 
763  FillInfo(_spill);
764  }
765  else{
766  std::cout << "Failed in reading entry " << entry << std::endl;
767  }
768  }
769 
770  entry++;
771  _RooVtxEntryInCurrentInputFile++;
772 
773 
774  return entry_temp;
775 }
TChain * fChain
The main TChain used to read events from the input file.
bool LoadGeometry(const std::string &file="", Int_t geomID=-1, const std::string &geomDir="")
Load the TGeoManager from the input root file. Returns true when the new geometry was loaded...

§ IncrementPOTBySpill()

void oaAnalysisTreeConverter::IncrementPOTBySpill ( )
virtual

Record the POT for the current spill, based on information in the AnaBeam member of the current AnaSpill.

Implements InputConverter.

Definition at line 778 of file oaAnalysisTreeConverter.cxx.

778  {
779 //********************************************************************
780 
781  bool bySpillInMC = false;
782 #if VERSION_HAS_OFFICIAL_POT
783  bySpillInMC=true;
784 #endif
785 
786  if (!IsMC || bySpillInMC)
787  // header().IncrementPOTBySpill(*_spill);
788  anaUtils::IncrementPOTBySpill(*_spill,header());
789 }
Header & header()
Returns the Header manager.

§ Initialize()

bool oaAnalysisTreeConverter::Initialize ( )
virtual

Any initialization that must be done. Called before the input file is read.

Use ReconDir/TrackerECal information?

Ignore TrueVertices when all their true tracks are fully contained

Implements InputConverter.

Definition at line 180 of file oaAnalysisTreeConverter.cxx.

180  {
181 //********************************************************************
182 
183  /// Use ReconDir/TrackerECal information?
184  _isUsingReconDirFGDOnly = ND::params().GetParameterI("highlandIO.FlatTree.UseReconDirFGDOnly");
185  _isUsingReconDirP0D = ND::params().GetParameterI("highlandIO.FlatTree.UseReconDirP0D");
186  _isUsingReconDirPECAL = ND::params().GetParameterI("highlandIO.FlatTree.UseReconDirP0DECal");
187  _isUsingReconDirTECAL = ND::params().GetParameterI("highlandIO.FlatTree.UseReconDirTrackerECal");
188 
189  // ---- TEST HIGHLAND2-P0D ----
190  _isUsingReconDirP0DNew = ND::params().GetParameterI("highlandIO.P0DDataClasses.UseReconDirP0DNew");
191  _p0dAlgoResName = ND::params().GetParameterS("highlandIO.P0DDataClasses.UseReconDirP0DAlgoResult");
192  _addGlobalTracksToP0DVertices = (bool)ND::params().GetParameterI("highlandIO.P0DDataClasses.AddGlobalTracksToP0DVertices");
193 
194  if (_isUsingReconDirP0D && _isUsingReconDirP0DNew){
195  std::cerr << "ERROR. oaAnalysisTreeConverter::Initialize(). 'highlandIO.FlatTree.UseReconDirP0D' and 'highlandIO.P0DRecon.UseReconDirP0DNew' are both set to 1 "
196  << "highlandIO.parameters.dat. Please switch off one of two !!!!" << std::endl;
197  exit(1);
198  }
199  // ----------------------------
200 
201  /// Ignore TrueVertices when all their true tracks are fully contained
202  _ignoreSMRDContainedTrueObjects = ND::params().GetParameterI("highlandIO.oaAnalysis.IgnoreSMRDContainedTrueObjects");
203  _ignoreP0DECalContainedTrueObjects = ND::params().GetParameterI("highlandIO.oaAnalysis.IgnoreP0DECalContainedTrueObjects");
204  _ignoreDsECalContainedTrueObjects = ND::params().GetParameterI("highlandIO.oaAnalysis.IgnoreDsECalContainedTrueObjects");
205  _ignoreBrECalContainedTrueObjects = ND::params().GetParameterI("highlandIO.oaAnalysis.IgnoreBrECalContainedTrueObjects");
206  _ignoreINGRIDContainedTrueObjects = ND::params().GetParameterI("highlandIO.oaAnalysis.IgnoreINGRIDContainedTrueObjects");
207 
208  // Remove uninteresting vertices
209  _removeTrueVerticesWithNoTrueParticles = ND::params().GetParameterI("highlandIO.oaAnalysis.RemoveTrueVerticesWithNoTrueParticles");
210 
211  AddChain("ReconDir/Global");
212  AddChain("TruthDir/Vertices");
213  AddChain("TruthDir/Trajectories");
214  AddChain("HeaderDir/BeamSummaryData");
215  AddChain("HeaderDir/BasicDataQuality");
216  AddChain("HeaderDir/BasicHeader");
217 
218  if(_isUsingReconDirFGDOnly) AddChain("ReconDir/FGDOnly");
219  if(_isUsingReconDirTECAL) AddChain("ReconDir/TrackerECal");
220  if(_isUsingReconDirP0D || _isUsingReconDirP0DNew) AddChain("ReconDir/P0D");
221 
222  reconGlobal = GetChain("ReconDir/Global");
223  mcTruthVertices = GetChain("TruthDir/Vertices");
224  mcTruthTrajectories = GetChain("TruthDir/Trajectories");
225  beamInfo = GetChain("HeaderDir/BeamSummaryData");
226  DQInfo = GetChain("HeaderDir/BasicDataQuality");
227  BasicHeader = GetChain("HeaderDir/BasicHeader");
228  accPOTInfo = NULL;//GetChain("HeaderDir/AccumulatedPOT");
229  GRooTrackerVTX = NULL;
230  NRooTrackerVTX = NULL;
231 
232  if(_isUsingReconDirFGDOnly) fgdOnly = GetChain("ReconDir/FGDOnly");
233  else fgdOnly = NULL;
234  if(_isUsingReconDirTECAL) trackerECAL = GetChain("ReconDir/TrackerECal");
235  else trackerECAL = NULL;
236  if(_isUsingReconDirP0D || _isUsingReconDirP0DNew) p0d = GetChain("ReconDir/P0D");
237  else p0d = NULL;
238 
239  fChain = reconGlobal;
240 
241  // Set branch addresses and branch pointers
242 
243  if (!fChain) return false;
244  fCurrent = -1;
245 
246  // ------------- TGlobalPIDs --------------------
247  PIDs = new TClonesArray("ND::TGlobalReconModule::TGlobalPID",20);
248  reconGlobal->SetBranchAddress("NPIDs", &NPIDs);
249  reconGlobal->SetBranchAddress("PIDs", &PIDs);
250 
251  FgdTimeBins = new TClonesArray("ND::TGlobalReconModule::TFgdTimeBin");
252  reconGlobal->SetBranchAddress("NFgdTimeBins", &NFgdTimeBins);
253  reconGlobal->SetBranchAddress("FgdTimeBins", &FgdTimeBins);
254 
255  Vertices = new TClonesArray("ND::TGlobalReconModule::TGlobalVertex",20);
256  reconGlobal->SetBranchAddress("NVertices",&NVertices);
257  reconGlobal->SetBranchAddress("Vertices",&Vertices);
258 
259  /*
260  DelayedClusters = new TClonesArray("ND::TGlobalReconModule::TFgdCluster",200);
261  reconGlobal->SetBranchAddress("DelayedClusters",&DelayedClusters);
262  reconGlobal->SetBranchAddress("NDelayedClusters",&NDelayedClusters);
263 
264  reconGlobal->SetBranchAddress("NFGD1Unused",&NFGD1Unused);
265  reconGlobal->SetBranchAddress("NFGD2Unused",&NFGD2Unused);
266  reconGlobal->SetBranchAddress("NP0DUnused",&NP0DUnused);
267  reconGlobal->SetBranchAddress("NTPCUnused",&NTPCUnused);
268 
269  TPCOthers = new TClonesArray("ND::TGlobalReconModule::TTPCOtherObject",20);
270  reconGlobal->SetBranchAddress("TPCOthers",&TPCOthers);
271  reconGlobal->SetBranchAddress("NTPCOthers",&NTPCOthers);
272  */
273 
274 
275  if( trackerECAL ) {
276  TrECalObjects = new TClonesArray("ND::TTrackerECALReconModule::TECALReconObject",20);
277  trackerECAL->SetBranchAddress("NReconObject",&NTrECalObjects);
278  trackerECAL->SetBranchAddress("ReconObject", &TrECalObjects);
279 
280  TrECalUnmatched = new TClonesArray("ND::TTrackerECALReconModule::TECALReconUnmatchedObject",20);
281  trackerECAL->SetBranchAddress("NUnmatchedObject",&NTrECalUnmatched);
282  trackerECAL->SetBranchAddress("UnmatchedObject", &TrECalUnmatched);
283  }
284 
285  if ( p0d ) {
286  // ---- TEST HIGHLAND2-P0D ----
287  P0DAlgoResults = new TClonesArray("ND::TP0DReconModule::TP0DAlgoRes",20);
288  p0d->SetBranchAddress("NAlgoResults",&NP0DAlgoResults);
289  p0d->SetBranchAddress("AlgoResults", &P0DAlgoResults);
290 
291  P0DReconVertices = new TClonesArray("ND::TP0DReconModule::TP0DVertex",100);
292  p0d->SetBranchAddress("NVertices",&NP0DReconVertices);
293  p0d->SetBranchAddress("Vertices", &P0DReconVertices);
294 
295  P0DReconParticles = new TClonesArray("ND::TP0DReconModule::TP0DParticle",100);
296  p0d->SetBranchAddress("NParticles",&NP0DReconParticles);
297  p0d->SetBranchAddress("Particles", &P0DReconParticles);
298 
299  P0DReconTracks = new TClonesArray("ND::TP0DReconModule::TP0DTrack",100);
300  p0d->SetBranchAddress("NTracks",&NP0DReconTracks);
301  p0d->SetBranchAddress("Tracks", &P0DReconTracks);
302 
303  P0DReconShowers = new TClonesArray("ND::TP0DReconModule::TP0DShower",100);
304  p0d->SetBranchAddress("NShowers",&NP0DReconShowers);
305  p0d->SetBranchAddress("Showers", &P0DReconShowers);
306 
307  P0DReconClusters = new TClonesArray("ND::TP0DReconModule::TP0DCluster",100);
308  p0d->SetBranchAddress("NClusters",&NP0DReconClusters);
309  p0d->SetBranchAddress("Clusters", &P0DReconClusters);
310 
311  P0DReconNodes = new TClonesArray("ND::TP0DReconModule::TP0DNode",100);
312  p0d->SetBranchAddress("NNodes",&NP0DReconNodes);
313  p0d->SetBranchAddress("Nodes", &P0DReconNodes);
314 
315  P0DReconHits = new TClonesArray("ND::TP0DReconModule::TP0DHit",100);
316  p0d->SetBranchAddress("NHits",&NP0DReconHits);
317  p0d->SetBranchAddress("Hits", &P0DReconHits);
318  // ------------------------------
319  }
320 
321  //--------------- True vertices -------------------
322  if (mcTruthVertices){
323  TruthVertices = new TClonesArray("ND::TTruthVerticesModule::TTruthVertex", 100);
324  mcTruthVertices->SetBranchAddress("NVtx", &NTruthVertices);
325  mcTruthVertices->SetBranchAddress("NVtxFGD1", &NVtxFGD1);
326  mcTruthVertices->SetBranchAddress("NVtxFGD2", &NVtxFGD2);
327  mcTruthVertices->SetBranchAddress("Vertices", &TruthVertices);
328  }
329 
330  //--------------- True Trajectories --------------
331  if (mcTruthTrajectories){
332  TruthTrajs = new TClonesArray("ND::TTruthTrajectoriesModule::TTruthTrajectory", 100);
333  mcTruthTrajectories->SetBranchAddress("NTraj", &NTruthTrajs);
334  mcTruthTrajectories->SetBranchAddress("Trajectories", &TruthTrajs);
335  }
336 
337  //------------- FGD information -----------------------
338  if (fgdOnly){
339  XZTracks_Radon2 = new TClonesArray("ND::TFgdOnlyModule::TFgd2DIsoTrack",200);
340  fgdOnly->SetBranchAddress("NXZTracks_Radon2", &NXZTracks_Radon2);
341  fgdOnly->SetBranchAddress("XZTracks_Radon2", &XZTracks_Radon2);
342 
343  YZTracks_Radon2 = new TClonesArray("ND::TFgdOnlyModule::TFgd2DIsoTrack",200);
344  fgdOnly->SetBranchAddress("NYZTracks_Radon2", &NYZTracks_Radon2);
345  fgdOnly->SetBranchAddress("YZTracks_Radon2", &YZTracks_Radon2);
346 
347  XYZTracks_Radon2 = new TClonesArray("ND::TFgdOnlyModule::TFgd3DIsoTrack",200);
348  fgdOnly->SetBranchAddress("NXYZTracks_Radon2", &NXYZTracks_Radon2);
349  fgdOnly->SetBranchAddress("XYZTracks_Radon2", &XYZTracks_Radon2);
350 
351  XZTracksAllFGD_Radon2 = new TClonesArray("ND::TFgdOnlyModule::TFgd2DIsoTrack",200);
352  fgdOnly->SetBranchAddress("NXZTracksAllFGD_Radon2", &NXZTracksAllFGD_Radon2);
353  fgdOnly->SetBranchAddress("XZTracksAllFGD_Radon2", &XZTracksAllFGD_Radon2);
354 
355  YZTracksAllFGD_Radon2 = new TClonesArray("ND::TFgdOnlyModule::TFgd2DIsoTrack",200);
356  fgdOnly->SetBranchAddress("NYZTracksAllFGD_Radon2", &NYZTracksAllFGD_Radon2);
357  fgdOnly->SetBranchAddress("YZTracksAllFGD_Radon2", &YZTracksAllFGD_Radon2);
358 
359  XYZTracksAllFGD_Radon2 = new TClonesArray("ND::TFgdOnlyModule::TFgd3DIsoTrack",200);
360  fgdOnly->SetBranchAddress("NXYZTracksAllFGD_Radon2", &NXYZTracksAllFGD_Radon2);
361  fgdOnly->SetBranchAddress("XYZTracksAllFGD_Radon2", &XYZTracksAllFGD_Radon2);
362  }
363 
364  //-------------- Beam summary --------------------
365  if (beamInfo){
366  beamSummary = new TClonesArray("ND::TBeamSummaryDataModule::TBeamSummaryData",200);
367  beamInfo->SetBranchAddress("BeamSummaryData", &beamSummary);
368  beamInfo->SetBranchAddress("BeamSummaryDataStatus", &beamSummaryDataStatus);
369  beamInfo->SetBranchAddress("ND280Spill", &ND280Spill);
370  }
371 
372  //-------------- Accumulated POT -----------------------
373  // if( AccPOTflg && accPOTInfo) {
374  // accPOTInfo->SetBranchAddress("AccPOT", &skimaccpotbtwEvt);
375  // }
376 
377 
378  //-------------- Header ---------------------------------
379  if (BasicHeader){
380  BasicHeader->SetBranchAddress("EventID", &EventID);
381  BasicHeader->SetBranchAddress("RunID", &RunID);
382  BasicHeader->SetBranchAddress("SubrunID", &SubrunID);
383  BasicHeader->SetBranchAddress("IsMC", &IsMC);
384  BasicHeader->SetBranchAddress("EventTime", &EventTime);
385  BasicHeader->SetBranchAddress("Preselected", &Preselected);
386  BasicHeader->SetBranchAddress("TriggerWord", &TriggerWord);
387  BasicHeader->SetBranchAddress("FGDCosmicEvent", &FGDCosmicEvent);
388  BasicHeader->SetBranchAddress("TripTCosmicEvent", &TripTCosmicEvent);
389  BasicHeader->SetBranchAddress("SoftwareVersion", &SoftwareVersion);
390  BasicHeader->SetBranchAddress("P0DWaterStatus", &P0DWaterStatus);
391 #if VERSION_HAS_OFFICIAL_POT
392  BasicHeader->SetBranchAddress("POTPerSpill", &POTPerSpill);
393 #endif
394  }
395 
396  //------------ DataQuality summary ----------------------
397  if (DQInfo){
398  DQInfo->SetBranchAddress("ND280OffFlag", &fND280OffFlag);
399  DQInfo->SetBranchAddress("TPCFlag", &fTPCFlag);
400  DQInfo->SetBranchAddress("TPC1Flag", &fTPC1Flag);
401  DQInfo->SetBranchAddress("TPC2Flag", &fTPC2Flag);
402  DQInfo->SetBranchAddress("TPC3Flag", &fTPC3Flag);
403  DQInfo->SetBranchAddress("FGDFlag", &fFGDFlag);
404  DQInfo->SetBranchAddress("FGD1Flag", &fFGD1Flag);
405  DQInfo->SetBranchAddress("FGD2Flag", &fFGD2Flag);
406  DQInfo->SetBranchAddress("ECALFlag", &fECALFlag);
407  DQInfo->SetBranchAddress("DSECALFlag", &fDSECALFlag);
408  DQInfo->SetBranchAddress("BarECALFlag", &fBarECALFlag);
409  DQInfo->SetBranchAddress("P0DECALFlag", &fP0DECALFlag);
410  DQInfo->SetBranchAddress("P0DFlag", &fP0DFlag);
411  DQInfo->SetBranchAddress("SMRDFlag", &fSMRDFlag);
412  DQInfo->SetBranchAddress("MAGNETFlag", &fMAGNETFlag);
413  DQInfo->SetBranchAddress("INGRIDFlag", &fINGRIDFlag);
414  }
415 
416  //Setup the TruthUtils
417  _truthUtils.SetTrajectoriesArray (TruthTrajs);
418  _truthUtils.SetVerticesArray (TruthVertices);
419  _truthUtils.SetTrajectoriesNumber(&NTruthTrajs);
420  _truthUtils.SetVerticesNumber (&NTruthVertices);
421 
422  return true;
423 }
int GetParameterI(std::string)
Get parameter. Value is returned as integer.
Definition: Parameters.cxx:217
bool _removeTrueVerticesWithNoTrueParticles
Remove uninteresting vertices.
void AddChain(const std::string &name, const std::string &name_path="")
std::string GetParameterS(std::string)
Get parameter. Value is returned as string.
Definition: Parameters.cxx:242
Int_t fCurrent
current Tree number in a TChain
TChain * GetChain(const std::string &name="")
bool _ignoreSMRDContainedTrueObjects
ignore some true objects when there are fully contained in the specified subdetectors ...
TChain * fChain
The main TChain used to read events from the input file.
bool _isUsingReconDirFGDOnly
Use local reconstruction information?

§ SetCosmicMode()

virtual void oaAnalysisTreeConverter::SetCosmicMode ( const bool  cosmic)
inlinevirtual

Specify whether we're running in "cosmic" mode or not. Some converters don't care about this, but others do and can override this function.

Reimplemented from InputConverter.

Definition at line 47 of file oaAnalysisTreeConverter.hxx.

47 {cosmic_mode = cosmic;}
bool cosmic_mode
Whether we&#39;re running in "cosmic" mode, where there is only one bunch.

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