SND@LHC Software
Loading...
Searching...
No Matches
hcalStructureFiller Class Reference

#include <hcalStructureFiller.h>

Inheritance diagram for hcalStructureFiller:
Collaboration diagram for hcalStructureFiller:

Public Member Functions

 hcalStructureFiller ()
 
 hcalStructureFiller (const char *name, const Int_t iVerbose=1, const char *fileGeo="hcal.geo")
 
virtual ~hcalStructureFiller ()
 
virtual InitStatus Init ()
 
virtual void Exec (Option_t *option)
 
virtual void Finish ()
 
void SetUseMCPoints (Bool_t UseMCPoints)
 
hcalStructureGetStructure () const
 
void StoreTrackInformation (Bool_t storetrackinfo=kTRUE)
 
Bool_t GetStoreTrackInformation () const
 
Bool_t GetUseMCPoints () const
 
Bool_t GetUseSummableHits () const
 
Bool_t GetUseHits () const
 

Private Member Functions

void SetParContainers ()
 
void LoopForMCPoints ()
 
 hcalStructureFiller (const hcalStructureFiller &)
 
hcalStructureFilleroperator= (const hcalStructureFiller &)
 

Private Attributes

hcalStructurefStr
 
hcalInffInf
 
TClonesArray * fListHCALpts
 
Int_t fEvent
 
Bool_t fInited
 Internal event counter.
 
Bool_t fUseMCPoints
 
Bool_t fStoreTrackInfo
 
TString fFileGeo
 

Detailed Description

Definition at line 24 of file hcalStructureFiller.h.

Constructor & Destructor Documentation

◆ hcalStructureFiller() [1/3]

hcalStructureFiller::hcalStructureFiller ( )

Default constructor

Definition at line 19 of file hcalStructureFiller.cxx.

20 : FairTask(),
21 fStr(NULL),
22 fInf(NULL),
23 fListHCALpts(NULL),
24 fEvent(0),
25 fInited(kFALSE),
26 fUseMCPoints(kFALSE),
27 fStoreTrackInfo(kTRUE),
28 fFileGeo("")
29{
30}
TClonesArray * fListHCALpts
Bool_t fInited
Internal event counter.

◆ hcalStructureFiller() [2/3]

hcalStructureFiller::hcalStructureFiller ( const char *  name,
const Int_t  iVerbose = 1,
const char *  fileGeo = "hcal.geo" 
)

Standard constructor

Definition at line 34 of file hcalStructureFiller.cxx.

35 : FairTask(name,iVerbose),
36 fStr(NULL),
37 fInf(hcalInf::GetInstance(fileGeo)),
38 fListHCALpts(NULL),
39 fEvent(0),
40 fInited(kFALSE),
41 fUseMCPoints(kFALSE),
42 fStoreTrackInfo(kTRUE),
43 fFileGeo(fileGeo)
44{
45}
static hcalInf * GetInstance(const char *filename)
Definition hcalInf.cxx:35

◆ ~hcalStructureFiller()

hcalStructureFiller::~hcalStructureFiller ( )
virtual

Destructor

Definition at line 50 of file hcalStructureFiller.cxx.

51{
52 ;
53}

◆ hcalStructureFiller() [3/3]

hcalStructureFiller::hcalStructureFiller ( const hcalStructureFiller )
private

Member Function Documentation

◆ Exec()

void hcalStructureFiller::Exec ( Option_t *  option)
virtual

Executed task

Definition at line 124 of file hcalStructureFiller.cxx.

125{
126 fEvent++;
127 if (fVerbose>0)
128 cout << "--> Event no. " << fEvent;
129
132
133 if (fVerbose>0)
134 cout << endl << flush;
135}

◆ Finish()

void hcalStructureFiller::Finish ( )
virtual

Finish task

Definition at line 140 of file hcalStructureFiller.cxx.

141{
142 ;
143}

◆ GetStoreTrackInformation()

Bool_t hcalStructureFiller::GetStoreTrackInformation ( ) const
inline

Definition at line 104 of file hcalStructureFiller.h.

105{
106 return fStoreTrackInfo;
107}

◆ GetStructure()

hcalStructure * hcalStructureFiller::GetStructure ( ) const
inline

Definition at line 109 of file hcalStructureFiller.h.

110{
111 return fStr;
112}

◆ GetUseHits()

Bool_t hcalStructureFiller::GetUseHits ( ) const

◆ GetUseMCPoints()

Bool_t hcalStructureFiller::GetUseMCPoints ( ) const
inline

Definition at line 93 of file hcalStructureFiller.h.

94{
95 return fUseMCPoints;
96}

◆ GetUseSummableHits()

Bool_t hcalStructureFiller::GetUseSummableHits ( ) const

◆ Init()

InitStatus hcalStructureFiller::Init ( )
virtual

Initialization of the task

Definition at line 62 of file hcalStructureFiller.cxx.

63{
64 fInited=kTRUE;
65 FairRootManager* fManager = FairRootManager::Instance();
66
67 if (fUseMCPoints==kFALSE)
68 {
69 Warning("Init()", "No data source for structure filler! Calorimeter structure will be empty.");
70// return kFATAL;
71 }
72 //HCAL MC points
73 if (fUseMCPoints)
74 fListHCALpts = (TClonesArray*)fManager->GetObject("HcalPointLite");
75
76 //fInf->CheckVariables();
79 fStr->Construct();
80
81 fManager->Register("HcalStructure", "HCAL", fStr, kFALSE);
82 return kSUCCESS;
83}
void SetUseMC(Int_t mc=0)

◆ LoopForMCPoints()

void hcalStructureFiller::LoopForMCPoints ( )
private

Loop over MCPoints

Loop over MCPoints hits and add them to modules

Definition at line 87 of file hcalStructureFiller.cxx.

88{
89 hcalPoint* pt=NULL;
90 hcalModule* module;
91 UInt_t n;
92 Int_t section;
93
94 n=fListHCALpts->GetEntriesFast();
95 if (fVerbose>0)
96 {
97 cout << ". Number of input MC points: ";
98 cout << n << flush;
99 }
100
101 for(UInt_t j=0; j<n; j++)
102 {
103 pt=(hcalPoint*)fListHCALpts->At(j);
104 module=fStr->GetModule(pt->GetDetectorID(), section);
105 cout << section << " " << pt->GetEnergyLoss() << endl;
106 if (section==0)
107 module->AddEnergy(pt->GetEnergyLoss());
108 else
109 module->AddEnergy2(pt->GetEnergyLoss());
110 }
111 if (fStoreTrackInfo)
112 for(UInt_t j=0; j<n; j++)
113 {
114 pt=(hcalPoint*)fListHCALpts->At(j);
115 hcalModuleMC* modulemc=(hcalModuleMC*)fStr->GetModule(pt->GetDetectorID(), section);
116 if (section==0)
117 modulemc->AddTrackEnergy(pt->GetTrackID(),pt->GetEnergyLoss());
118 else
119 modulemc->AddTrackEnergy2(pt->GetTrackID(),pt->GetEnergyLoss());
120 }
121}
void AddTrackEnergy(Int_t num, Float_t energy)
void AddTrackEnergy2(Int_t num, Float_t energy)
hcalModule * GetModule(Float_t x, Float_t y) const

◆ operator=()

hcalStructureFiller & hcalStructureFiller::operator= ( const hcalStructureFiller )
private

◆ SetParContainers()

void hcalStructureFiller::SetParContainers ( )
private

Init parameter containers

Definition at line 56 of file hcalStructureFiller.cxx.

57{
58 ;
59}

◆ SetUseMCPoints()

void hcalStructureFiller::SetUseMCPoints ( Bool_t  UseMCPoints)
inline

Set data source for hit producer. This must be called before Init() (No effect other case)!

Definition at line 87 of file hcalStructureFiller.h.

88{
89 if (fInited) return;
90 fUseMCPoints=UseMCPoints;
91}

◆ StoreTrackInformation()

void hcalStructureFiller::StoreTrackInformation ( Bool_t  storetrackinfo = kTRUE)
inline

Definition at line 98 of file hcalStructureFiller.h.

99{
100 if (fInited) return;
101 fStoreTrackInfo=storetrackinfo;
102}

Member Data Documentation

◆ fEvent

Int_t hcalStructureFiller::fEvent
private

Definition at line 68 of file hcalStructureFiller.h.

◆ fFileGeo

TString hcalStructureFiller::fFileGeo
private

Geo file to use

Definition at line 78 of file hcalStructureFiller.h.

◆ fInf

hcalInf* hcalStructureFiller::fInf
private

Definition at line 65 of file hcalStructureFiller.h.

◆ fInited

Bool_t hcalStructureFiller::fInited
private

Internal event counter.

Is Init() already done?

Definition at line 71 of file hcalStructureFiller.h.

◆ fListHCALpts

TClonesArray* hcalStructureFiller::fListHCALpts
private

Definition at line 67 of file hcalStructureFiller.h.

◆ fStoreTrackInfo

Bool_t hcalStructureFiller::fStoreTrackInfo
private

Should we store information about tracks/energy depostion

Definition at line 76 of file hcalStructureFiller.h.

◆ fStr

hcalStructure* hcalStructureFiller::fStr
private

Definition at line 64 of file hcalStructureFiller.h.

◆ fUseMCPoints

Bool_t hcalStructureFiller::fUseMCPoints
private

Should we take data from MCPoints?

Definition at line 73 of file hcalStructureFiller.h.


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