FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairMCMatchLoaderTask.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 // -------------------------------------------------------------------------
9 // ----- FairMCMatchLoaderTask source file -----
10 // ----- Created 18/07/08 by T.Stockmanns -----
11 // -------------------------------------------------------------------------
12 #include "FairMCMatchLoaderTask.h"
13 
14 #include "FairMCMatch.h" // for FairMCMatch
15 #include "FairRootManager.h" // for FairRootManager
16 
17 #include <TClonesArray.h> // for TClonesArray
18 #include <iostream> // for operator<<, basic_ostream, etc
19 
21  : FairTask("Creates FairMCMatch")
22  , fMCMatch(nullptr)
23  , fMCLink(nullptr)
24  , fEventNr(0)
25 {}
26 
28 
30 {
31  fMCMatch = new FairMCMatch("FairMCMatch", "FairMCMatch");
32 
34 
35  /*
36  fMCMatch->InitStage("MVDPoint");
37  fMCMatch->InitStage("MVDStripDigis");
38  fMCMatch->InitStage("MVDPixelDigis");
39  fMCMatch->InitStage("MVDHitsPixel");
40  fMCMatch->InitStage("MVDHitsStrip");
41  fMCMatch->InitStage("MVDPixelClusterCand");
42  fMCMatch->InitStage("MVDStripClusterCand");
43 
44  fMCMatch->InitStage("EmcCluster");
45  fMCMatch->InitStage("EmcBump");
46  fMCMatch->InitStage("EmcDigi");
47  fMCMatch->InitStage("EmcHit");
48  fMCMatch->InitStage("EmcPoint");
49  fMCMatch->InitStage("EmcRecoHit");
50  fMCMatch->InitStage("EmcSharedDigi");
51  fMCMatch->InitStage("EmcWaveform");
52 
53  fMCMatch->InitStage("STTPoint");
54  fMCMatch->InitStage("STTHit");
55  fMCMatch->InitStage("SttHelixHit");
56  fMCMatch->InitStage("STTTrack");
57  fMCMatch->InitStage("STTTrackCand");
58 
59  fMCMatch->InitStage("PndTpcPoint");
60  fMCMatch->InitStage("PndTpcPrimaryCluster");
61  fMCMatch->InitStage("PndTpcDriftedElectron");
62  fMCMatch->InitStage("PndTpcAvalanche");
63  fMCMatch->InitStage("PndTpcSignal");
64  fMCMatch->InitStage("PndTpcDigi");
65  fMCMatch->InitStage("PndTpcCluster");
66 
67 
68  fMCMatch->InitStage("GEMPoint");
69  fMCMatch->InitStage("GEMDigi");
70  fMCMatch->InitStage("GEMHit");
71 
72  fMCMatch->InitStage("PndDchPoint");
73  fMCMatch->InitStage("PndDchDigi");
74  fMCMatch->InitStage("PndDchCylinderHit");
75 
76  fMCMatch->InitStage("MdtPoint");
77  fMCMatch->InitStage("MdtHit");
78  fMCMatch->InitStage("MdtTrk");
79 
80  fMCMatch->InitStage("LheHit");
81  fMCMatch->InitStage("LheCandidate");
82  fMCMatch->InitStage("LheTrack");
83  fMCMatch->InitStage("MVDIdealTrackCand");
84  fMCMatch->InitStage("MVDRiemannTrackCand");
85  //fMCMatch->InitStage("PndTrack");
86  fMCMatch->InitStage("LheGenTrack");
87  fMCMatch->InitStage("PidChargedCand");
88  fMCMatch->InitStage("PidNeutralCand");
89  */
90 
92  if (!ioman) {
93  std::cout << "-E- FairMCMatchLoaderTask::Init: "
94  << "RootManager not instantiated!" << std::endl;
95  return kFATAL;
96  }
97 
98  fMCLink = static_cast<TClonesArray*>(ioman->GetObject("MCLink"));
99  ioman->Register("MCMatch", "MCInfo", fMCMatch, kFALSE);
100 
101  return kSUCCESS;
102 }
103 
105 
106 void FairMCMatchLoaderTask::Exec(Option_t* /*opt*/)
107 {
108 
109  if (!fMCLink) {
110  Fatal("Exec", "No fMCLink");
111  }
113 
114  fMCMatch->LoadInMCLists(fMCLink);
115  fMCMatch->CreateArtificialStage("MCTrack");
116 
117  fMCMatch->Print();
118  std::cout << std::endl;
119 }
120 
122 
InitStatus
Definition: FairTask.h:33
virtual void Exec(Option_t *opt)
virtual InitStatus Init()
static FairRootManager * Instance()
ClassImp(FairEventBuilder)
TObject * GetObject(const char *BrName)
void CreateArtificialStage(const TString &branchName, const std::string &fileName="")
void Register(const char *name, const char *Foldername, TNamed *obj, Bool_t toFile)
void ClearMCList()
virtual void InitDataStages()=0
void LoadInMCLists(TClonesArray *myLinkArray)