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

#include <hcal.h>

Inheritance diagram for hcal:
Collaboration diagram for hcal:

Public Member Functions

 hcal ()
 
 hcal (const char *name, Bool_t active, const char *fileGeo="hcal.geo")
 
virtual ~hcal ()
 
virtual Bool_t ProcessHits (FairVolume *vol=NULL)
 
virtual void ConstructGeometry ()
 
virtual void EndOfEvent ()
 
virtual void BeginEvent ()
 
virtual void Reset ()
 
virtual void Print () const
 
virtual void CopyClones (TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
 
virtual void Register ()
 
virtual void ChangeHit (hcalPoint *oldHit=NULL)
 
virtual void FinishPrimary ()
 
virtual void Initialize ()
 
virtual TClonesArray * GetCollection (Int_t iColl) const
 
virtual void SetSpecialPhysicsCuts ()
 

Static Public Member Functions

static Bool_t GetCellCoord (Int_t fVolumeID, Float_t &x, Float_t &y, Int_t &section)
 
static Bool_t GetCellCoordInf (Int_t fVolumeID, Float_t &x, Float_t &y, Int_t &section)
 

Protected Member Functions

hcalPointAddHit (Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgcode)
 
hcalPointAddLiteHit (Int_t trackID, Int_t detID, Double32_t time, Double32_t eLoss)
 

Private Member Functions

Bool_t FillLitePoint (Int_t volnum)
 
void FillWallPoint ()
 
void ResetParameters ()
 
void SetHcalCuts (Int_t medium)
 
hcalPointFindHit (Int_t VolId, Int_t TrackId)
 
Int_t GetVolType (Int_t volnum)
 
TGeoVolume * ConstructRaw (Int_t number)
 
void ConstructModule ()
 
void ConstructTile (Int_t material)
 
void ConstructModuleSimple ()
 
void ConstructTileSimple (Int_t material)
 
Int_t InitMedium (const char *name)
 
void InitMedia ()
 
 hcal (const hcal &)
 
hcaloperator= (const hcal &)
 

Private Attributes

hcalInffInf
 
Option_t * fDebug
 
Int_t fTrackID
 
Int_t fVolumeID
 
TLorentzVector fPos
 
TLorentzVector fMom
 
Double32_t fTime
 
Double32_t fLength
 
Double32_t fELoss
 
Int_t fPosIndex
 
TClonesArray * fHcalCollection
 
TClonesArray * fLiteCollection
 
Float_t fHcalSize [3]
 
Int_t fSimpleGeo
 
Int_t fFastMC
 
Int_t fXSize
 
Int_t fYSize
 
Float_t fDX
 
Float_t fDY
 
Float_t fModuleSize
 
Float_t fZHcal
 
Float_t fSemiX
 
Float_t fSemiY
 
TString fAbsorber
 
Float_t fThicknessAbsorber
 
Float_t fThicknessScin
 
Float_t fThicknessTyvk
 
Float_t fThicknessLayer
 
Float_t fThicknessSteel
 
Float_t fEdging
 
Float_t fHoleRad
 
Float_t fFiberRad
 
Float_t fXCell
 
Float_t fYCell
 
Int_t fNH
 
Int_t fCF
 
TString fLightMapName
 
hcalLightMapfLightMap
 
Int_t fNLayers
 
Int_t fNLayers1
 
Float_t fModuleLength
 
Int_t fVolIdMax
 
Int_t fFirstNumber
 
Int_t fVolArr [kNumberOfHCALSensitiveVolumes]
 
TGeoVolume * fModule
 
TGeoVolume * fScTile
 Calorimeter Modules.
 
TGeoVolume * fTileEdging
 Pb tiles.
 
TGeoVolume * fPbTile
 Edging of scintillator tiles.
 
TGeoVolume * fTvTile
 Scintillator tiles.
 
TGeoVolume * fHoleVol [3]
 Tyvek sheets.
 
TGeoVolume * fFiberVol [3]
 Hole volume.
 
TGeoVolume * fSteelTapes [2]
 Fiber volume.
 
TGeoTranslation ** fHolePos
 Steel tapes.
 
Int_t fModules
 Positions of holes.
 
std::list< std::pair< Int_t, TGeoVolume * > > fRawNumber
 Number of mudules.
 
Int_t fStructureId
 List of constructed raws.
 

Detailed Description

Definition at line 31 of file hcal.h.

Constructor & Destructor Documentation

◆ hcal() [1/3]

hcal::hcal ( )

Default constructor

Definition at line 45 of file hcal.cxx.

46 : FairDetector("HCAL", kTRUE, khcal),
47 fInf(NULL),
48 fDebug(NULL),
49 fTrackID(-1),
50 fVolumeID(-1),
51 fPos(),
52 fMom(),
53 fTime(-1.),
54 fLength(-1.),
55 fELoss(-1.),
56 fPosIndex(0),
57 fHcalCollection(new TClonesArray("hcalPoint")),
58 fLiteCollection(new TClonesArray("hcalPoint")),
59 fHcalSize(),
60 fSimpleGeo(0),
61 fFastMC(0),
62 fXSize(0),
63 fYSize(0),
64 fDX(0.),
65 fDY(0.),
66 fModuleSize(0.),
67 fZHcal(0.),
68 fSemiX(0.),
69 fSemiY(0.),
70 fAbsorber("Lead"),
76 fEdging(0.),
77 fHoleRad(0.),
78 fFiberRad(0.),
79 fXCell(0),
80 fYCell(0),
81 fNH(0),
82 fCF(0),
83 fLightMapName(""),
84 fLightMap(NULL),
85 fNLayers(0),
86 fModuleLength(0.),
87 fVolIdMax(0),
88 fFirstNumber(0),
89 fVolArr(),
90 fModule(NULL),
91 fScTile(NULL),
92 fTileEdging(NULL),
93 fPbTile(NULL),
94 fTvTile(NULL),
95 fHoleVol(),
96 fFiberVol(),
98 fHolePos(),
99 fModules(0),
100 fRawNumber(),
101 fStructureId(0)
102{
103 fVerboseLevel = 1;
104
105 Int_t i;
106
107 for(i=kN-1;i>-1;i--)
108 fVolArr[i]=-1111;
109}
@ khcal
Int_t fVolIdMax
Definition hcal.h:191
Option_t * fDebug
Definition hcal.h:108
Int_t fCF
Definition hcal.h:179
std::list< std::pair< Int_t, TGeoVolume * > > fRawNumber
Number of mudules.
Definition hcal.h:223
Int_t fXSize
Definition hcal.h:144
Float_t fZHcal
Definition hcal.h:152
Float_t fModuleLength
Definition hcal.h:189
TString fAbsorber
Definition hcal.h:157
Float_t fXCell
Definition hcal.h:175
Int_t fYSize
Definition hcal.h:145
Int_t fSimpleGeo
Definition hcal.h:140
Float_t fSemiY
Definition hcal.h:155
hcalInf * fInf
Definition hcal.h:107
Int_t fVolumeID
Definition hcal.h:117
Int_t fPosIndex
Definition hcal.h:129
Int_t fTrackID
Definition hcal.h:115
TClonesArray * fHcalCollection
Definition hcal.h:132
hcalLightMap * fLightMap
Definition hcal.h:183
Int_t fFastMC
Definition hcal.h:142
Float_t fYCell
Definition hcal.h:176
Int_t fNLayers
Definition hcal.h:185
Float_t fThicknessTyvk
Definition hcal.h:163
TGeoVolume * fScTile
Calorimeter Modules.
Definition hcal.h:214
Int_t fNH
Definition hcal.h:178
TGeoVolume * fTileEdging
Pb tiles.
Definition hcal.h:215
Float_t fHoleRad
Definition hcal.h:171
TGeoVolume * fPbTile
Edging of scintillator tiles.
Definition hcal.h:216
Int_t fFirstNumber
Definition hcal.h:193
TGeoVolume * fSteelTapes[2]
Fiber volume.
Definition hcal.h:220
Int_t fVolArr[kNumberOfHCALSensitiveVolumes]
Definition hcal.h:200
Float_t fHcalSize[3]
Definition hcal.h:137
Double32_t fLength
Definition hcal.h:125
TLorentzVector fMom
Definition hcal.h:121
TGeoVolume * fHoleVol[3]
Tyvek sheets.
Definition hcal.h:218
Int_t fModules
Positions of holes.
Definition hcal.h:222
TClonesArray * fLiteCollection
Definition hcal.h:134
TGeoVolume * fModule
Definition hcal.h:213
Float_t fDX
Definition hcal.h:147
Double32_t fELoss
Definition hcal.h:127
Float_t fSemiX
Definition hcal.h:154
Float_t fThicknessAbsorber
Definition hcal.h:159
Float_t fThicknessLayer
Definition hcal.h:165
Double32_t fTime
Definition hcal.h:123
Float_t fDY
Definition hcal.h:148
Float_t fThicknessScin
Definition hcal.h:161
TGeoTranslation ** fHolePos
Steel tapes.
Definition hcal.h:221
Float_t fModuleSize
Definition hcal.h:150
TGeoVolume * fTvTile
Scintillator tiles.
Definition hcal.h:217
TString fLightMapName
Definition hcal.h:181
TGeoVolume * fFiberVol[3]
Hole volume.
Definition hcal.h:219
Float_t fFiberRad
Definition hcal.h:173
Int_t fStructureId
List of constructed raws.
Definition hcal.h:226
Float_t fEdging
Definition hcal.h:169
Float_t fThicknessSteel
Definition hcal.h:167
TLorentzVector fPos
Definition hcal.h:119
#define kN
Definition ecal.cxx:43
int i
Definition ShipAna.py:86

◆ hcal() [2/3]

hcal::hcal ( const char *  name,
Bool_t  active,
const char *  fileGeo = "hcal.geo" 
)

Standard constructor.

Parameters
namedetetcor name
activesensitivity flag

hcal constructor: reads geometry parameters from the ascii file <fileGeo>, creates the ECAL geometry container hcalInf and initializes basic geometry parameters needed to construct TGeo geometry

Counting modules

Definition at line 115 of file hcal.cxx.

116 : FairDetector(name, active, khcal),
117 fInf(NULL),
118 fDebug(NULL),
119 fTrackID(-1),
120 fVolumeID(-1),
121 fPos(),
122 fMom(),
123 fTime(-1.),
124 fLength(-1.),
125 fELoss(-1.),
126 fPosIndex(0),
127 fHcalCollection(new TClonesArray("hcalPoint")),
128 fLiteCollection(new TClonesArray("hcalPoint")),
129 fHcalSize(),
130 fSimpleGeo(0),
131 fFastMC(0),
132 fXSize(0),
133 fYSize(0),
134 fDX(0.),
135 fDY(0.),
136 fModuleSize(0.),
137 fZHcal(0.),
138 fSemiX(0.),
139 fSemiY(0.),
140 fAbsorber("Lead"),
142 fThicknessScin(0.),
143 fThicknessTyvk(0.),
144 fThicknessLayer(0.),
145 fThicknessSteel(0.),
146 fEdging(0.),
147 fHoleRad(0.),
148 fFiberRad(0.),
149 fXCell(0),
150 fYCell(0),
151 fNH(0),
152 fCF(0),
153 fLightMapName(""),
154 fLightMap(NULL),
155 fNLayers(0),
156 fModuleLength(0.),
157 fVolIdMax(0),
158 fFirstNumber(0),
159 fVolArr(),
160 fModule(NULL),
161 fScTile(NULL),
162 fTileEdging(NULL),
163 fPbTile(NULL),
164 fTvTile(NULL),
165 fHoleVol(),
166 fFiberVol(),
167 fSteelTapes(),
168 fHolePos(),
169 fModules(0),
170 fRawNumber(),
171 fStructureId(0)
172{
180 fVerboseLevel=0;
181 Int_t i;
182 Int_t j;
183 TString nm;
184 Info("hcal","Geometry is read from file %s.", fileGeo);
185 fInf=hcalInf::GetInstance(fileGeo);
186 if (fInf==NULL)
187 {
188 Fatal("hcal"," Can't read geometry from %s.", fileGeo);
189 return;
190 }
194
196
201
204
205 fPosIndex=0;
206 fDebug="";
207
208 fSemiX=fInf->GetVariableStrict("xsemiaxis");
209 fSemiY=fInf->GetVariableStrict("ysemiaxis");
210 fHoleRad=fInf->GetVariableStrict("holeradius");
211 fFiberRad=fInf->GetVariableStrict("fiberradius");
213 fEdging=fInf->GetVariableStrict("tileedging");
214 fModuleSize=fInf->GetVariableStrict("modulesize");
215 fSimpleGeo=(Int_t)fInf->GetVariableStrict("usesimplegeo");
216 fFastMC=(Int_t)fInf->GetVariableStrict("fastmc");
217 fDX=fInf->GetVariableStrict("xpos");
218 fDY=fInf->GetVariableStrict("ypos");
220
221 for(i=kN-1;i>-1;i--)
222 fVolArr[i]=-1111;
223
224 for(i=0;i<2;i++)
225 {
226 fSteelTapes[i]=NULL;
227 }
228 for(i=0;i<3;i++)
229 {
230 fHoleVol[i]=NULL;
231 fFiberVol[i]=NULL;
232 }
234 for(i=0;i<fInf->GetXSize();i++)
235 for(j=0;j<fInf->GetYSize();j++)
236 {
237 if (fInf->GetType(i,j)==0) continue;
238 if (fInf->GetType(i,j)==1)
239 fModules++;
240 else
241 Fatal("hcal", "Wrong module type");
242 }
243
244 fCF=(Int_t)fInf->GetVariableStrict("cf");
245 fNH=(Int_t)fInf->GetVariableStrict("nh");
247 if (fLightMapName!="none")
249 else
250 fLightMap=NULL;
251 fAbsorber=fInf->GetStringVariable("absorbermaterial");
252 Info("hcal", "Number of modules is %d, lightmap %s", fModules, fLightMapName.Data());
255 Info("hcal", "Size of cell of type %d is %f cm.", i, fXCell);
256}
Double_t GetAbsorber() const
Definition hcalInf.h:40
Double_t GetScin() const
Definition hcalInf.h:41
Int_t GetN1Layers() const
Definition hcalInf.h:39
static hcalInf * GetInstance(const char *filename)
Definition hcalInf.cxx:35
Double_t GetVariableStrict(const char *key)
Definition hcalInf.cxx:82
Double_t GetHcalSize(Int_t num) const
Definition hcalInf.h:55
Double_t GetTyveec() const
Definition hcalInf.h:42
Int_t GetNLayers() const
Definition hcalInf.h:38
Int_t GetYSize() const
Definition hcalInf.h:47
Int_t GetXSize() const
Definition hcalInf.h:46
char GetType(Int_t x, Int_t y) const
Definition hcalInf.h:158
TString GetStringVariable(const char *key)
Definition hcalInf.cxx:103
Double_t GetZPos() const
Definition hcalInf.h:34
Int_t fNLayers1
Definition hcal.h:187

◆ ~hcal()

hcal::~hcal ( )
virtual

Destructor

Definition at line 273 of file hcal.cxx.

274{
275 if (fHcalCollection) {
276 fHcalCollection->Delete();
277 delete fHcalCollection;
278 fHcalCollection=NULL;
279 }
280 if (fLiteCollection) {
281 fLiteCollection->Delete();
282 delete fLiteCollection;
283 fLiteCollection=NULL;
284 }
285}

◆ hcal() [3/3]

hcal::hcal ( const hcal )
private

Member Function Documentation

◆ AddHit()

hcalPoint * hcal::AddHit ( Int_t  trackID,
Int_t  detID,
TVector3  pos,
TVector3  mom,
Double_t  time,
Double_t  length,
Double_t  eLoss,
Int_t  pdgcode 
)
protected

Definition at line 791 of file hcal.cxx.

794{
795 TClonesArray& clref = *fHcalCollection;
796 Int_t size = clref.GetEntriesFast();
797 return new(clref[size]) hcalPoint(trackID, detID, pos, mom,
798 time, length, eLoss, pdgcode);
799}

◆ AddLiteHit()

hcalPoint * hcal::AddLiteHit ( Int_t  trackID,
Int_t  detID,
Double32_t  time,
Double32_t  eLoss 
)
protected

Definition at line 803 of file hcal.cxx.

804{
805 TClonesArray& clref = *fLiteCollection;
806 Int_t size = clref.GetEntriesFast();
807 return new(clref[size]) hcalPoint(trackID, detID, time, eLoss);
808}

◆ BeginEvent()

void hcal::BeginEvent ( )
virtual

Definition at line 781 of file hcal.cxx.

782{
783 ;
784}

◆ ChangeHit()

void hcal::ChangeHit ( hcalPoint oldHit = NULL)
virtual

Definition at line 315 of file hcal.cxx.

316{
317 Double_t edep = fELoss;
318 Double_t el=oldHit->GetEnergyLoss();
319 Double_t ttime=gMC->TrackTime()*1.0e9;
320 oldHit->SetEnergyLoss(el+edep);
321 if(ttime<oldHit->GetTime())
322 oldHit->SetTime(ttime);
323}

◆ ConstructGeometry()

void hcal::ConstructGeometry ( )
virtual

Virtual method Construct geometry

Constructs the HCAL geometry

Initialize all media

Definition at line 659 of file hcal.cxx.

660{
661 FairGeoLoader*geoLoad = FairGeoLoader::Instance();
662 FairGeoInterface *geoFace = geoLoad->getGeoInterface();
663 FairGeoMedia *Media = geoFace->getMedia();
664 FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
665
666 TGeoVolume *top=gGeoManager->GetTopVolume();
667
668 // cout << top->GetName() << endl;
669 TGeoVolume *volume;
670 FairGeoMedium *CbmMedium;
671 TGeoPgon *spl;
672
673 Float_t *buf = 0;
674 Int_t i;
675 Double_t par[10];
676 Float_t y;
677 TString nm;
679 Double_t moduleth=thickness*fNLayers;
680// Float_t sumWeight;
681// Int_t i;
682
683 // create SensVacuum which is defined in the media file
684
686 InitMedia();
687 par[0]=fSemiX;
688 par[1]=fSemiY;
689 par[2]=fHcalSize[2]/2.0;
690
691 if (!IsActive()){
692 Double_t fudgeFactor = 6.34 / 13.7 ; // to have same interaction length as before
693 par[2] = par[2]*fudgeFactor;
694 volume=gGeoManager->Volume("Hcal", "BOX", gGeoManager->GetMedium("iron")->GetId(), par, 3);
695 gGeoManager->Node("Hcal", 1, top->GetName(), 0.0,0.0, fZHcal, 0, kTRUE, buf, 0);
696 return;
697 }
698
699 volume=gGeoManager->Volume("Hcal", "BOX", gGeoManager->GetMedium("SensVacuum")->GetId(), par, 3);
700 gGeoManager->Node("Hcal", 1, top->GetName(), 0.0,0.0, fZHcal, 0, kTRUE, buf, 0);
701 volume->SetVisLeaves(kTRUE);
702 volume->SetVisContainers(kFALSE);
703 volume->SetVisibility(kFALSE);
704
705
706 AddSensitiveVolume(volume);
707 fStructureId=volume->GetNumber();
708
709 if (fFastMC==0)
710 {
711 if (fSimpleGeo==0)
713 else
715
716 TGeoVolume* vol=new TGeoVolumeAssembly("HcalStructure");
717//To suppress warring
718 vol->SetMedium(gGeoManager->GetMedium("SensVacuum"));
719 for(i=0;i<fYSize;i++)
720 {
721 volume=ConstructRaw(i);
722 if (volume==NULL)
723 {
724 continue;
725 }
726 nm=volume->GetName();
727 y=(i-fYSize/2.0+0.5)*fModuleSize;
728 gGeoManager->Node(nm.Data(), i+1, "HcalStructure", 0.0, y, 0.0, 0, kTRUE, buf, 0);
729 }
730//TODO:
731//Should move the guarding volume, not structure itself
732 gGeoManager->Node("HcalStructure", 1, "Hcal", fDX, fDY, 0.0, 0, kTRUE, buf, 0);
733 }
734}
void ConstructModule()
Definition hcal.cxx:812
void InitMedia()
Definition hcal.cxx:944
TGeoVolume * ConstructRaw(Int_t number)
Definition hcal.cxx:738
void ConstructModuleSimple()
Definition hcal.cxx:877

◆ ConstructModule()

void hcal::ConstructModule ( )
private

Construct a module

Definition at line 812 of file hcal.cxx.

813{
814 if (fModule!=NULL) return;
815
816 ConstructTile(0);
817 ConstructTile(1);
819
820 TString nm="HcalModule";
821 TString nm1;
822 TString cellname="HcalCell";
823 TString scin="ScTile";
824 TString lead="LeadTile";
825 TString tyvek="TvTile";
826 Int_t i;
827 Int_t j;
828 Int_t n;
829 Float_t x;
830 Float_t y;
831 Float_t* buf=NULL;
833 Double_t moduleth=thickness*fNLayers;
834 Double_t par[3]={fModuleSize/2.0, fModuleSize/2.0, moduleth/2.0};
835
836 if (fSteelTapes[0]==NULL)
837 {
838 TGeoBBox* st1=new TGeoBBox(fThicknessSteel/2.0, fModuleSize/2.0-fThicknessSteel, moduleth/2.0);
839 nm1="HcalModuleSteelTape1";
840 fSteelTapes[0]=new TGeoVolume(nm1.Data(), st1, gGeoManager->GetMedium("ECALSteel"));
841 }
842 if (fSteelTapes[1]==NULL)
843 {
844 TGeoBBox* st2=new TGeoBBox(fModuleSize/2.0-fThicknessSteel, fThicknessSteel/2.0, moduleth/2.0);
845 nm1="HcalModuleSteelTape2";
846 fSteelTapes[1]=new TGeoVolume(nm1.Data(), st2, gGeoManager->GetMedium("ECALSteel"));
847 }
848
849
850// TGeoVolume* modulev=new TGeoVolumeAssembly(nm);
851 TGeoVolume* modulev=gGeoManager->Volume(nm.Data(), "BOX", gGeoManager->GetMedium("ECALAir")->GetId(), par, 3);
852 modulev->SetLineColor(kOrange+3);
853 for(i=0;i<fNLayers;i++)
854 {
855 gGeoManager->Node(scin.Data(), i+1, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin/2.0+i*thickness, 0, kTRUE, buf, 0);
856 gGeoManager->Node(lead.Data(), i+1, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin+i*thickness+fThicknessTyvk+fThicknessAbsorber/2.0, 0, kTRUE, buf, 0);
857 if (fThicknessTyvk>0.0)
858 {
859 gGeoManager->Node(tyvek.Data(), 2*i+1, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin+i*thickness+1.5*fThicknessTyvk+fThicknessAbsorber, 0, kTRUE, buf, 0);
860 gGeoManager->Node(tyvek.Data(), 2*i+2, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin+i*thickness+0.5*fThicknessTyvk, 0, kTRUE, buf, 0);
861 }
862 }
863
864 nm1="HcalModuleSteelTape1";
865 gGeoManager->Node(nm1.Data(), 1, nm.Data(), -fThicknessSteel/2.0+fModuleSize/2.0, 0.0, 0.0, 0, kTRUE, buf, 0);
866 gGeoManager->Node(nm1.Data(), 2, nm.Data(), +fThicknessSteel/2.0-fModuleSize/2.0, 0.0, 0.0, 0, kTRUE, buf, 0);
867 nm1="HcalModuleSteelTape2";
868 gGeoManager->Node(nm1.Data(), 1, nm.Data(), 0.0, -fThicknessSteel/2.0+fModuleSize/2.0, 0.0, 0, kTRUE, buf, 0);
869 gGeoManager->Node(nm1.Data(), 2, nm.Data(), 0.0, +fThicknessSteel/2.0-fModuleSize/2.0, 0.0, 0, kTRUE, buf, 0);
870
871 fModuleLength=moduleth;
872 fModule=modulev;
873}
void ConstructTile(Int_t material)
Definition hcal.cxx:960

◆ ConstructModuleSimple()

void hcal::ConstructModuleSimple ( )
private

Next method for simplified geometry Construct a module

Definition at line 877 of file hcal.cxx.

878{
879 if (fModule!=NULL) return;
880
884
885 TString nm="HcalModule";
886 TString nm1;
887 TString cellname="HcalCell";
888 TString scin="ScTile";
889 TString lead="LeadTile";
890 TString tyvek="TvTile";
891 Int_t i;
892 Int_t j;
893 Int_t n;
894 Float_t x;
895 Float_t y;
896 Float_t* buf=NULL;
898 Double_t moduleth=thickness*fNLayers;
899 Double_t par[3]={fModuleSize/2.0, fModuleSize/2.0, moduleth/2.0};
900
901// TGeoVolume* modulev=new TGeoVolumeAssembly(nm);
902 TGeoVolume* modulev=gGeoManager->Volume(nm.Data(), "BOX", gGeoManager->GetMedium("ECALAir")->GetId(), par, 3);
903 modulev->SetLineColor(kOrange+3);
904 for(i=0;i<fNLayers;i++)
905 {
906 gGeoManager->Node(scin.Data(), i+1, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin/2.0+i*thickness, 0, kTRUE, buf, 0);
907 gGeoManager->Node(lead.Data(), i+1, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin+i*thickness+fThicknessTyvk+fThicknessAbsorber/2.0, 0, kTRUE, buf, 0);
908 if (fThicknessTyvk>0.0)
909 {
910 gGeoManager->Node(tyvek.Data(), 2*i+1, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin+i*thickness+1.5*fThicknessTyvk+fThicknessAbsorber, 0, kTRUE, buf, 0);
911 gGeoManager->Node(tyvek.Data(), 2*i+2, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin+i*thickness+0.5*fThicknessTyvk, 0, kTRUE, buf, 0);
912 }
913 }
914
915 fModuleLength=moduleth;
916 fModule=modulev;
917}
void ConstructTileSimple(Int_t material)
Definition hcal.cxx:1106

◆ ConstructRaw()

TGeoVolume * hcal::ConstructRaw ( Int_t  number)
private

Construct a raw of modules

Definition at line 738 of file hcal.cxx.

739{
740 Int_t i;
741 list<pair<Int_t, TGeoVolume*> >::const_iterator p=fRawNumber.begin();
742 pair<Int_t, TGeoVolume*> out;
743 Float_t x;
744 Float_t* buf=NULL;
745 for(i=0;i<fXSize;i++)
746 if ((Int_t)fInf->GetType(i, num)!=0) break;
747 if (i==fXSize)
748 return NULL;
749 for(;p!=fRawNumber.end();++p)
750 {
751 for(i=0;i<fXSize;i++)
752 if (fInf->GetType(i, num)!=fInf->GetType(i, (*p).first))
753 break;
754 if (i==fXSize)
755 break;
756 }
757 if (p!=fRawNumber.end())
758 return (*p).second;
759 TString nm="HCALRaw"; nm+=num;
760 TString md;
761 TGeoVolume* vol=new TGeoVolumeAssembly(nm);
762//To suppress warring
763 vol->SetMedium(gGeoManager->GetMedium("SensVacuum"));
764 for(i=0;i<fXSize;i++)
765 {
766 x=(i-fXSize/2.0+0.5)*fModuleSize;
767 if (fInf->GetType(i, num)==0) continue;
768 md="HcalModule";
769 gGeoManager->Node(md.Data(),i+1, nm.Data(), x, 0.0, 0.0, 0, kTRUE, buf, 0);
770 }
771
772 out.first=num;
773 out.second=vol;
774 fRawNumber.push_back(out);
775 return out.second;
776}

◆ ConstructTile()

void hcal::ConstructTile ( Int_t  material)
private

Construct a tile

Building tile

Adding edging to scintillator

Definition at line 960 of file hcal.cxx.

961{
962 switch (material)
963 {
964 case 0: if (fScTile!=NULL) return; break;
965 case 1: if (fPbTile!=NULL) return; break;
966 case 2: if (fTvTile!=NULL) return; break;
967 default: Error("ConstructTile", "Can't construct a tile of type %d.", material);
968 }
969 Double_t thickness;
970 TGeoVolume* hole;
971 TGeoVolume* fiber;
972 TGeoTranslation** tr;
973 TGeoTranslation* tm;
974 Int_t nh=fNH;
975 Int_t i;
976 Int_t j;
977 TString nm;
978 TString nm1;
979 TString nm2;
980 TString medium;
981 Double_t x;
982 Double_t y;
983 TGeoBBox* tile;
984 TGeoVolume* tilev;
985 TGeoBBox* edging;
986 TGeoVolume* edgingv;
987 Double_t* buf=NULL;
988
989 switch (material)
990 {
991 case 0: thickness=fThicknessScin/2.0; break;
992 case 1: thickness=fThicknessAbsorber/2.0; break;
993 case 2: thickness=fThicknessTyvk/2.0; break;
994 default: Error("ConstructTile", "Can't construct a tile of type %d.", material);
995 }
996
997 if (thickness<=0.0) return;
998 // Holes in the tiles
999 if (fHoleRad>0)
1000 {
1001 nm1="ECALHole_"; nm1+=material;
1002 nm2="ECALFiber_"; nm2+=material;
1003 if (fHoleVol[material]==NULL)
1004 {
1005 TGeoTube* holetube=new TGeoTube(0, fHoleRad, thickness);
1006 fHoleVol[material]=new TGeoVolume(nm1.Data(), holetube, gGeoManager->GetMedium("ECALAir"));
1007 }
1008 hole=fHoleVol[material];
1009 // Fibers in holes
1010 if (fFiberRad>0)
1011 {
1012 if (fFiberVol[material]==NULL)
1013 {
1014 TGeoTube* fibertube=new TGeoTube(0, fFiberRad, thickness);
1015 fFiberVol[material]=new TGeoVolume(nm2.Data(), fibertube, gGeoManager->GetMedium("ECALFiber"));
1016 gGeoManager->Node(nm2.Data(), 1, nm1.Data(), 0.0, 0.0, 0.0, 0, kTRUE, buf, 0);
1017 }
1018 fiber=fFiberVol[material];
1019 // TODO: Cerenkoff !!!
1020 //AddSensitiveVolume(fiber);
1021 }
1022 }
1023/*
1024 if (fHolePos==NULL)
1025 {
1026 tr=new TGeoTranslation*[nh*nh];
1027 for(i=0;i<nh;i++)
1028 for(j=0;j<nh;j++)
1029 {
1030 nm="sh"; nm+="_"; nm+=j*nh+i;
1031 x=(i-nh/2+0.5)*fXCell/nh;
1032 y=(j-nh/2+0.5)*fYCell/nh;
1033
1034
1035 tm=new TGeoTranslation(nm, x, y, 0);
1036 gGeoManager->AddTransformation(tm);
1037 tr[j*nh+i]=tm;
1038 }
1039 fHolePos=tr;
1040 }
1041 tr=fHolePos;
1042*/
1044 switch (material)
1045 {
1046 case 0: nm="ScTile"; medium="Scintillator"; break;
1047 case 1: nm="LeadTile"; medium=fAbsorber; break;
1048 case 2: nm="TvTile"; medium="Tyvek"; break;
1049 default: Error("ConstructTile", "Can't construct a tile of type %d.", material);
1050 }
1051
1052 if (material==0)
1053 tile=new TGeoBBox(fXCell/2.0, fYCell/2.0, thickness);
1054 else
1055 tile=new TGeoBBox(fXCell/2.0+fEdging, fYCell/2.0+fEdging, thickness);
1056 tilev=new TGeoVolume(nm, tile, gGeoManager->GetMedium(medium));
1057 if (fHoleRad>0)
1058 {
1059 nm1="ECALHole_"; nm1+=material;
1060 for(i=0;i<nh;i++)
1061 for(j=0;j<nh;j++)
1062 {
1063 x=(i-nh/2+0.5)*fXCell/nh;
1064 y=(j-nh/2+0.5)*fYCell/nh;
1065 gGeoManager->Node(nm1.Data(), j*nh+i+1, nm.Data(), x, y, 0.0, 0, kTRUE, buf, 0);
1066 }
1067 // clear fiber
1068 if (nh%2==0&&fCF!=0)
1069 gGeoManager->Node(nm1.Data(), j*nh+i+1, nm.Data(), 0.0, 0.0, 0.0, 0, kTRUE, buf, 0);
1070
1071 }
1072/*
1073 if (fHoleRad>0)
1074 {
1075 for(i=0;i<nh;i++)
1076 for(j=0;j<nh;j++)
1077 tilev->AddNode(hole, j*nh+i+1, tr[j*nh+i]);
1078 // Clear Fiber
1079 if (nh%2==0)
1080 tilev->AddNode(hole, j*nh+i+1);
1081 }
1082*/
1084 if (material==0)
1085 {
1086 AddSensitiveVolume(tilev);
1087 edging=new TGeoBBox(fXCell/2.0+fEdging, fYCell/2.0+fEdging, thickness);
1088
1089 edgingv=new TGeoVolume(nm+"_edging", edging, gGeoManager->GetMedium("ECALTileEdging"));
1090 edgingv->AddNode(tilev, 1);
1091 fScTile=tilev;
1092 fTileEdging=edgingv;
1093 }
1094 else
1095 {
1096 if (material==1) //Lead
1097 fPbTile=tilev;
1098 else
1099 fTvTile=tilev;
1100 return;
1101 }
1102}

◆ ConstructTileSimple()

void hcal::ConstructTileSimple ( Int_t  material)
private

Construct a tile

Building tile

Adding edging to scintillator

Definition at line 1106 of file hcal.cxx.

1107{
1108 switch (material)
1109 {
1110 case 0: if (fScTile!=NULL) return; break;
1111 case 1: if (fPbTile!=NULL) return; break;
1112 case 2: if (fTvTile!=NULL) return; break;
1113 default: Error("ConstructTileSimple", "Can't construct a tile of type %d.", material);
1114 }
1115 Double_t thickness;
1116 TGeoVolume* hole;
1117 TGeoVolume* fiber;
1118 TGeoTranslation** tr;
1119 TGeoTranslation* tm;
1120 Int_t nh=fNH;
1121 Int_t i;
1122 Int_t j;
1123 TString nm;
1124 TString nm1;
1125 TString nm2;
1126 TString medium;
1127 Double_t x;
1128 Double_t y;
1129 TGeoBBox* tile;
1130 TGeoVolume* tilev;
1131 TGeoBBox* edging;
1132 TGeoVolume* edgingv;
1133 Double_t* buf=NULL;
1134
1135 switch (material)
1136 {
1137 case 0: thickness=fThicknessScin/2.0; break;
1138 case 1: thickness=fThicknessAbsorber/2.0; break;
1139 case 2: thickness=fThicknessTyvk/2.0; break;
1140 default: Error("ConstructTile", "Can't construct a tile of type %d.", material);
1141 }
1142
1143 if (thickness<=0.0) return;
1145 switch (material)
1146 {
1147 case 0: nm="ScTile"; medium="Scintillator"; break;
1148 case 1: nm="LeadTile"; medium=fAbsorber; break;
1149 case 2: nm="TvTile"; medium="Tyvek"; break;
1150 default: Error("ConstructTile", "Can't construct a tile of type %d.", material);
1151 }
1152
1153 tile=new TGeoBBox(fModuleSize/2.0, fModuleSize/2.0, thickness);
1154 tilev=new TGeoVolume(nm, tile, gGeoManager->GetMedium(medium));
1156 if (material==0)
1157 {
1158 AddSensitiveVolume(tilev);
1159 fScTile=tilev;
1160 fTileEdging=tilev;
1161 }
1162 else
1163 {
1164 if (material==1) //Absorber
1165 fPbTile=tilev;
1166 else
1167 fTvTile=tilev;
1168 return;
1169 }
1170}

◆ CopyClones()

void hcal::CopyClones ( TClonesArray *  cl1,
TClonesArray *  cl2,
Int_t  offset 
)
virtual

Definition at line 615 of file hcal.cxx.

616{
617 Int_t nEntries = cl1->GetEntriesFast();
618 Int_t i;
619 Int_t index;
620 cout << "-I- hcal: " << nEntries << " entries to add." << endl;
621 TClonesArray& clref = *cl2;
622 if (cl1->GetClass()==hcalPoint::Class()) {
623 hcalPoint* oldpoint = NULL;
624 for (i=0; i<nEntries; i++) {
625 oldpoint = (hcalPoint*) cl1->At(i);
626 index = oldpoint->GetTrackID()+offset;
627 oldpoint->SetTrackID(index);
628 new (clref[fPosIndex]) hcalPoint(*oldpoint);
629 fPosIndex++;
630 }
631 cout << "-I- hcal: " << cl2->GetEntriesFast() << " merged entries."
632 << endl;
633 }
634 else if (cl1->GetClass()==hcalPoint::Class()) {
635 hcalPoint* oldpoint = NULL;
636 for (i=0; i<nEntries; i++) {
637 oldpoint = (hcalPoint*) cl1->At(i);
638 index = oldpoint->GetTrackID()+offset;
639 oldpoint->SetTrackID(index);
640 new (clref[fPosIndex]) hcalPoint(*oldpoint);
641 fPosIndex++;
642 }
643 cout << "-I- hcal: " << cl2->GetEntriesFast() << " merged entries."
644 << endl;
645 }
646}

◆ EndOfEvent()

void hcal::EndOfEvent ( )
virtual

Definition at line 561 of file hcal.cxx.

561 {
562 if (fVerboseLevel) Print();
563 fHcalCollection->Clear();
564
565 fLiteCollection->Clear();
566 fPosIndex = 0;
567 fFirstNumber=0;
568}
virtual void Print() const
Definition hcal.cxx:591

◆ FillLitePoint()

Bool_t hcal::FillLitePoint ( Int_t  volnum)
private

Fill MC points inside the ECAL for non-zero deposited energy

Need to rewrite this part

Definition at line 520 of file hcal.cxx.

521{
524 //Search for input track
525
526 static Float_t zmin=fZHcal-0.0001;
527 static Float_t zmax=fZHcal+fHcalSize[2];
528 static Float_t xhcal=fHcalSize[0]/2;
529 static Float_t yhcal=fHcalSize[1]/2;
530 TParticle* part=gMC->GetStack()->GetCurrentTrack();
531 fTrackID=gMC->GetStack()->GetCurrentTrackNumber();
532
533// cout << zmin << " : " << zmax << " : " << xhcal << ", " << yhcal << endl;
534// cout << part->GetFirstMother() << " : " << part->Vx() << ", " << part->Vy() << ", " << part->Vz() << endl;
536 while (part->GetFirstMother()>=0&&part->Vz()>=zmin&&part->Vz()<=zmax&&TMath::Abs(part->Vx())<=xhcal&&TMath::Abs(part->Vy())<=yhcal)
537 {
538 fTrackID=part->GetFirstMother();
539 part =((ShipStack*)gMC->GetStack())->GetParticle(fTrackID);
540// cout << "-> " << part->GetFirstMother() << " : " << part->Vx() << ", " << part->Vy() << ", " << part->Vz() << endl;
541 }
542// if (part->Vz()>500)
543// cout << part->Vx() << ", " << part->Vy() << ", " << part->Vz() << endl;
544#ifdef _DECAL
545 if (fTrackID<0) cout<<"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!fTrackID="<<fTrackID<<endl;
546#endif
547 hcalPoint* oldHit;
548 hcalPoint* newHit;
549
550 if ((oldHit=FindHit(fVolumeID,fTrackID))!=NULL)
551 ChangeHit(oldHit);
552 else
553 // Create hcalPoint for scintillator volumes
555
556
557 return kTRUE;
558}
virtual void ChangeHit(hcalPoint *oldHit=NULL)
Definition hcal.cxx:315
hcalPoint * AddLiteHit(Int_t trackID, Int_t detID, Double32_t time, Double32_t eLoss)
Definition hcal.cxx:803
hcalPoint * FindHit(Int_t VolId, Int_t TrackId)
Definition hcal.cxx:509

◆ FillWallPoint()

void hcal::FillWallPoint ( )
private

Fill MC points on the ECAL front wall

Definition at line 483 of file hcal.cxx.

484{
487 gMC->TrackPosition(fPos);
488 gMC->TrackMomentum(fMom);
489 fVolumeID = -1;
490 Double_t mass = gMC->TrackMass();
491 // Calculate kinetic energy
492 Double_t ekin = TMath::Sqrt( fMom.Px()*fMom.Px() +
493 fMom.Py()*fMom.Py() +
494 fMom.Pz()*fMom.Pz() +
495 mass * mass ) - mass;
496 fELoss = ekin;
497 // Create hcalPoint at the entrance of calorimeter
498 // for particles with pz>0 coming through the front wall
499 if (fMom.Pz() > 0 && fPos.Z() < fZHcal+0.01)
500 {
501 TParticle* part=((ShipStack*)gMC->GetStack())->GetParticle(fTrackID);
502 AddHit(fTrackID, fVolumeID, TVector3(fPos.X(), fPos.Y(), fPos.Z()),
503 TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength,
504 fELoss, part->GetPdgCode());
505 }
506 fTrackID=gMC->GetStack()->GetCurrentTrackNumber();
507}
hcalPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgcode)
Definition hcal.cxx:791
mass(particle)
Definition hnl.py:47

◆ FindHit()

hcalPoint * hcal::FindHit ( Int_t  VolId,
Int_t  TrackId 
)
private

Definition at line 509 of file hcal.cxx.

510{
511 for(Int_t i=fFirstNumber;i<fLiteCollection->GetEntriesFast();i++)
512 {
513 hcalPoint* point=(hcalPoint*)fLiteCollection->At(i);
514 if (point->GetTrackID()==TrackId&&point->GetDetectorID()==VolId)
515 return point;
516 }
517 return NULL;
518}

◆ FinishPrimary()

void hcal::FinishPrimary ( )
virtual

Definition at line 309 of file hcal.cxx.

310{
311 fFirstNumber=fLiteCollection->GetEntriesFast();
312}

◆ GetCellCoord()

Bool_t hcal::GetCellCoord ( Int_t  fVolumeID,
Float_t &  x,
Float_t &  y,
Int_t &  section 
)
static

Get cell coordinates according to parameter container

Definition at line 1203 of file hcal.cxx.

1204{
1205 return GetCellCoordInf(fVolID, x, y, section);
1206}
static Bool_t GetCellCoordInf(Int_t fVolumeID, Float_t &x, Float_t &y, Int_t &section)
Definition hcal.cxx:1174

◆ GetCellCoordInf()

Bool_t hcal::GetCellCoordInf ( Int_t  fVolumeID,
Float_t &  x,
Float_t &  y,
Int_t &  section 
)
static

Get cell coordinates according to current hcalInf

Definition at line 1174 of file hcal.cxx.

1175{
1176 static hcalInf* inf=NULL;
1177 if (inf==NULL)
1178 {
1179 inf=hcalInf::GetInstance(NULL);
1180 if (inf==NULL)
1181 {
1182 cerr << "hcal::GetCellCoordInf(): Can't get geometry information." << endl;
1183 return kFALSE;
1184 }
1185 }
1186 Int_t volid=fVolID;
1187 section=volid%10; volid=volid-section; volid/=10;
1188 Int_t mx=volid%100; volid-=mx; volid/=100;
1189 Int_t my=volid%100; volid-=my; volid/=100;
1190 static Float_t modulesize=inf->GetVariableStrict("modulesize");
1191 static Float_t xcalosize=inf->GetHcalSize(0);
1192 static Float_t ycalosize=inf->GetHcalSize(1);
1193 static Float_t dx=inf->GetVariableStrict("xpos");
1194 static Float_t dy=inf->GetVariableStrict("ypos");
1195 x=mx*modulesize-xcalosize/2.0+1.0; x+=dx;
1196 y=my*modulesize-ycalosize/2.0+1.0; y+=dy;
1197
1198 return kFALSE;
1199}

◆ GetCollection()

TClonesArray * hcal::GetCollection ( Int_t  iColl) const
virtual

Accessor to the hit collection

Definition at line 572 of file hcal.cxx.

573{
574 if (iColl == 0) return fHcalCollection;
575 if (iColl == 1) return fLiteCollection;
576 else return NULL;
577}

◆ GetVolType()

Int_t hcal::GetVolType ( Int_t  volnum)
private

returns type of volume

Definition at line 472 of file hcal.cxx.

473{
474 Int_t i;
475 for(i=kN-1;i>-1;i--) {
476 if (fVolArr[i]==volnum) break;
477 }
478
479 return i;
480}

◆ Initialize()

void hcal::Initialize ( )
virtual

Definition at line 260 of file hcal.cxx.

261{
262 FairDetector::Initialize();
263/*
264 FairRun* sim = FairRun::Instance();
265 FairRuntimeDb* rtdb=sim->GetRuntimeDb();
266 CbmGeoHcalPar *par=new CbmGeoHcalPar();
267// fInf->FillGeoPar(par,0);
268 rtdb->addContainer(par);
269*/
270}

◆ InitMedia()

void hcal::InitMedia ( )
private

Initialize all calorimter media

Definition at line 944 of file hcal.cxx.

945{
946 Info("InitMedia", "Initializing media.");
947 InitMedium("SensVacuum");
948 InitMedium("ECALVacuum");
949 InitMedium(fAbsorber.Data());
950 InitMedium("Scintillator");
951 InitMedium("Tyvek");
952 InitMedium("ECALAir");
953 InitMedium("ECALFiber");
954 InitMedium("ECALSteel");
955 InitMedium("ECALTileEdging");
956}
Int_t InitMedium(const char *name)
Definition hcal.cxx:921

◆ InitMedium()

Int_t hcal::InitMedium ( const char *  name)
private

Initialize medium with given name

Definition at line 921 of file hcal.cxx.

922{
923 static FairGeoLoader *geoLoad=FairGeoLoader::Instance();
924 static FairGeoInterface *geoFace=geoLoad->getGeoInterface();
925 static FairGeoMedia *media=geoFace->getMedia();
926 static FairGeoBuilder *geoBuild=geoLoad->getGeoBuilder();
927
928 FairGeoMedium *CbmMedium=media->getMedium(name);
929
930 if (!CbmMedium)
931 {
932 Fatal("InitMedium","Material %s not defined in media file.", name);
933 return -1111;
934 }
935 TGeoMedium* medium=gGeoManager->GetMedium(name);
936 if (medium!=NULL)
937 return CbmMedium->getMediumIndex();
938
939 return geoBuild->createMedium(CbmMedium);
940}

◆ operator=()

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

◆ Print()

void hcal::Print ( ) const
virtual

Definition at line 591 of file hcal.cxx.

592{
593 Int_t nHits = fHcalCollection->GetEntriesFast();
594 Int_t nLiteHits;
595 Int_t i;
596
597 cout << "-I- hcal: " << nHits << " points registered in this event.";
598 cout << endl;
599
600 nLiteHits=fLiteCollection->GetEntriesFast();
601 cout << "-I- hcal: " << nLiteHits << " lite points registered in this event.";
602 cout << endl;
603
604 if (fVerboseLevel>1)
605 {
606 for (i=0;i<nHits;i++)
607 (*fHcalCollection)[i]->Print();
608 for (i=0;i<nLiteHits;i++)
609 (*fLiteCollection)[i]->Print();
610 }
611}

◆ ProcessHits()

Bool_t hcal::ProcessHits ( FairVolume *  vol = NULL)
virtual

Virtual method ProcessHits

Defines the action to be taken when a step is inside the active volume. Creates hcal and adds them to the collection.

Parameters
volPointer to the active volume

Fill MC point for sensitive ECAL volumes

Definition at line 351 of file hcal.cxx.

352{
354 TString Hcal="Hcal";
355 fELoss = gMC->Edep();
356 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
357 fTime = gMC->TrackTime()*1.0e09;
358 fLength = gMC->TrackLength();
359
360 //if (vol->getVolumeId()==fStructureId) {
361 if (Hcal.CompareTo(gMC->CurrentVolName())==0) {
362 if (gMC->IsTrackEntering()) {
364 ((ShipStack*)gMC->GetStack())->AddPoint(khcal, fTrackID);
365
367
368 return kTRUE;
369 } else {
370 return kFALSE;
371 }
372 }
373
374 if (fELoss<=0) return kFALSE;
375
376 if (fELoss>0)
377 {
378 Int_t i;
379 TParticle* p=gMC->GetStack()->GetCurrentTrack();
380 Double_t x, y, z;
381 Double_t px;
382 Double_t py;
383 Double_t dx;
384 Int_t mx;
385 Int_t my;
386 Int_t type;
387 Int_t cx;
388 Int_t cy;
389 Int_t layer;
390 gMC->TrackPosition(x, y, z);
391// cout << "Id: " << p->GetPdgCode() << " (" << x << ", " << y << ", ";
392// cout << z << "): ";
393// cout << endl;
394/*
395 for(i=0;i<10;i++)
396 {
397 gMC->CurrentVolOffID(i, mx); cout << i << ":" << mx << ", ";
398 }
399 cout << endl;
400*/
401 if (fSimpleGeo==0)
402 {
403 gMC->CurrentVolOffID(1, layer); layer--;
404 gMC->CurrentVolOffID(2, mx); mx--;
405 gMC->CurrentVolOffID(3, my); my--;
406 }
407 else
408 {
409 gMC->CurrentVolOffID(0, layer); layer--;
410 gMC->CurrentVolOffID(1, mx); mx--;
411 gMC->CurrentVolOffID(2, my); my--;
412 }
413 Int_t id=(my*100+mx)*10;
414 if (layer>fNLayers1) id++;
415// cout << mx << "(" << x << "), " << my << "(" << y << "), layer="<< layer << endl;
416/*
417 Float_t rx; Float_t ry; Int_t ten;
418 GetCellCoordInf(id, rx, ry, ten); rx--; ry--;
419 type=fInf->GetType(mx, my);
420 Float_t d=fInf->GetVariableStrict("modulesize")/type;
421 if (x>rx-0.001&&x<rx+d+0.001&&y>ry-0.001&&y<ry+d+0.001)
422 {
423// cout << "+++ ";
424 ;
425 }
426 else
427 {
428 cout << mx << ", " << my << ", " << cell << endl;
429 cout << "--- ";
430 cout << "(" << x << ", " << y << ") : (" << rx << ", " << ry << ")" << endl;
431 }
432*/
434 if (fSimpleGeo==0)
435 {
436 // An old version
437 // px=mx*fModuleSize-fHcalSize[0]/2.0+cx*fModuleSize/type;
438 // py=my*fModuleSize-fHcalSize[1]/2.0+cy*fModuleSize/type;
439 // With correction for steel tapes and edging
440 // TODO: Check this
443
444 px=(x-px)/fXCell;
445 py=(y-py)/fYCell;
446 if (px>=0&&px<1&&py>=0&&py<1)
447 {
448 fELoss*=fLightMap->Data(px-0.5, py-0.5);
449 FillLitePoint(0);
450 }
451 }
452 else
453 FillLitePoint(0);
454// for(i=0;i<8;i++)
455// {
456// Int_t t;
457//
458// gMC->CurrentVolOffID(i, t);
459// cout << i << ": " << gMC->CurrentVolOffName(i) << " " << t << "; ";
460// }
461// cout << endl;
462 }
463 ((ShipStack*)gMC->GetStack())->AddPoint(khcal, fTrackID);
464
466
467 return kTRUE;
468
469}
Double_t Data(Double_t x, Double_t y)
Bool_t FillLitePoint(Int_t volnum)
Definition hcal.cxx:520
void ResetParameters()
Definition hcal.h:238
void FillWallPoint()
Definition hcal.cxx:483

◆ Register()

void hcal::Register ( )
virtual

Definition at line 650 of file hcal.cxx.

651{
652 FairRootManager::Instance()->Register("HcalPoint","Hcal",fHcalCollection,kTRUE);
653 FairRootManager::Instance()->Register("HcalPointLite","HcalLite",fLiteCollection,kTRUE);
654 ;
655}

◆ Reset()

void hcal::Reset ( )
virtual

Definition at line 581 of file hcal.cxx.

582{
583 fHcalCollection->Clear();
584 fLiteCollection->Clear();
586 fFirstNumber=0;
587}

◆ ResetParameters()

void hcal::ResetParameters ( )
inlineprivate

Private method ResetParameters

Resets the private members for the track parameters

Definition at line 238 of file hcal.h.

239{
240 fTrackID = fVolumeID = 0;
241 fPos.SetXYZM(0.0, 0.0, 0.0, 0.0);
242 fMom.SetXYZM(0.0, 0.0, 0.0, 0.0);
243 fTime = fLength = fELoss = 0;
244 fPosIndex = 0;
245};

◆ SetHcalCuts()

void hcal::SetHcalCuts ( Int_t  medium)
private

Set GEANT3 tracking energy cuts for selected medium

Definition at line 289 of file hcal.cxx.

290{
292 if (fInf->GetElectronCut() > 0) {
293 gMC->Gstpar(medium,"CUTGAM",fInf->GetElectronCut());
294 gMC->Gstpar(medium,"CUTELE",fInf->GetElectronCut());
295 gMC->Gstpar(medium,"BCUTE" ,fInf->GetElectronCut());
296 gMC->Gstpar(medium,"BCUTM" ,fInf->GetElectronCut());
297 }
298
299 if (fInf->GetHadronCut() > 0) {
300 gMC->Gstpar(medium,"CUTNEU",fInf->GetHadronCut());
301 gMC->Gstpar(medium,"CUTHAD",fInf->GetHadronCut());
302 gMC->Gstpar(medium,"CUTMUO",fInf->GetHadronCut());
303// gMC->Gstpar(medium,"PPCUTM",fInf->GetHadronCut());
304 }
305 ;
306}
Double_t GetElectronCut() const
Definition hcalInf.h:52
Double_t GetHadronCut() const
Definition hcalInf.h:53

◆ SetSpecialPhysicsCuts()

void hcal::SetSpecialPhysicsCuts ( )
virtual

Definition at line 326 of file hcal.cxx.

327{
328 FairRun* fRun = FairRun::Instance();
329// if (strcmp(fRun->GetName(),"TGeant3") == 0)
330 {
331 Int_t mediumID;
332 mediumID = gGeoManager->GetMedium("Scintillator")->GetId();
333 SetHcalCuts(mediumID);
334 mediumID = gGeoManager->GetMedium(fAbsorber)->GetId();
335 SetHcalCuts(mediumID);
336 mediumID = gGeoManager->GetMedium("Tyvek")->GetId();
337 SetHcalCuts(mediumID);
338 mediumID = gGeoManager->GetMedium("SensVacuum")->GetId();
339 SetHcalCuts(mediumID);
340 mediumID = gGeoManager->GetMedium("ECALAir")->GetId();
341 SetHcalCuts(mediumID);
342 mediumID = gGeoManager->GetMedium("ECALFiber")->GetId();
343 SetHcalCuts(mediumID);
344 mediumID = gGeoManager->GetMedium("ECALTileEdging")->GetId();
345 SetHcalCuts(mediumID);
346 mediumID = gGeoManager->GetMedium("ECALSteel")->GetId();
347 SetHcalCuts(mediumID);
348 }
349}
void SetHcalCuts(Int_t medium)
Definition hcal.cxx:289

Member Data Documentation

◆ fAbsorber

TString hcal::fAbsorber
private

Name of absorber material/media

Definition at line 157 of file hcal.h.

◆ fCF

Int_t hcal::fCF
private

Definition at line 179 of file hcal.h.

◆ fDebug

Option_t* hcal::fDebug
private

Definition at line 108 of file hcal.h.

◆ fDX

Float_t hcal::fDX
private

Position of calorimeter center

Definition at line 147 of file hcal.h.

◆ fDY

Float_t hcal::fDY
private

Definition at line 148 of file hcal.h.

◆ fEdging

Float_t hcal::fEdging
private

Thickness of tile edging [cm]

Definition at line 169 of file hcal.h.

◆ fELoss

Double32_t hcal::fELoss
private

energy loss

Definition at line 127 of file hcal.h.

◆ fFastMC

Int_t hcal::fFastMC
private

Just construct guarding volume

Definition at line 142 of file hcal.h.

◆ fFiberRad

Float_t hcal::fFiberRad
private

Radius of fibers in calorimeter [cm]

Definition at line 173 of file hcal.h.

◆ fFiberVol

TGeoVolume* hcal::fFiberVol[3]
private

Hole volume.

Definition at line 219 of file hcal.h.

◆ fFirstNumber

Int_t hcal::fFirstNumber
private

Number of first hit for current primary

Definition at line 193 of file hcal.h.

◆ fHcalCollection

TClonesArray* hcal::fHcalCollection
private

MC point collection on HCAL wall

Definition at line 132 of file hcal.h.

◆ fHcalSize

Float_t hcal::fHcalSize[3]
private

HCAL geometry parameters x,y,z size of outer HCAL box [cm]

Definition at line 137 of file hcal.h.

◆ fHolePos

TGeoTranslation** hcal::fHolePos
private

Steel tapes.

Definition at line 221 of file hcal.h.

◆ fHoleRad

Float_t hcal::fHoleRad
private

Radius of holes in the calorimeter [cm]

Definition at line 171 of file hcal.h.

◆ fHoleVol

TGeoVolume* hcal::fHoleVol[3]
private

Tyvek sheets.

Definition at line 218 of file hcal.h.

◆ fInf

hcalInf* hcal::fInf
private

Definition at line 107 of file hcal.h.

◆ fLength

Double32_t hcal::fLength
private

length

Definition at line 125 of file hcal.h.

◆ fLightMap

hcalLightMap* hcal::fLightMap
private

Light maps

Definition at line 183 of file hcal.h.

◆ fLightMapName

TString hcal::fLightMapName
private

Names of light maps

Definition at line 181 of file hcal.h.

◆ fLiteCollection

TClonesArray* hcal::fLiteCollection
private

MC point collection inside HCAL

Definition at line 134 of file hcal.h.

◆ fModule

TGeoVolume* hcal::fModule
private

Definition at line 213 of file hcal.h.

◆ fModuleLength

Float_t hcal::fModuleLength
private

Lenght of calorimeter module

Definition at line 189 of file hcal.h.

◆ fModules

Int_t hcal::fModules
private

Positions of holes.

Definition at line 222 of file hcal.h.

◆ fModuleSize

Float_t hcal::fModuleSize
private

Size of calorimeter module [cm]

Definition at line 150 of file hcal.h.

◆ fMom

TLorentzVector hcal::fMom
private

momentum

Definition at line 121 of file hcal.h.

◆ fNH

Int_t hcal::fNH
private

Number of holes in modules

Definition at line 178 of file hcal.h.

◆ fNLayers

Int_t hcal::fNLayers
private

number of layers per module

Definition at line 185 of file hcal.h.

◆ fNLayers1

Int_t hcal::fNLayers1
private

number of layers in first section

Definition at line 187 of file hcal.h.

◆ fPbTile

TGeoVolume* hcal::fPbTile
private

Edging of scintillator tiles.

Definition at line 216 of file hcal.h.

◆ fPos

TLorentzVector hcal::fPos
private

position

Definition at line 119 of file hcal.h.

◆ fPosIndex

Int_t hcal::fPosIndex
private

Definition at line 129 of file hcal.h.

◆ fRawNumber

std::list<std::pair<Int_t, TGeoVolume*> > hcal::fRawNumber
private

Number of mudules.

Definition at line 223 of file hcal.h.

◆ fScTile

TGeoVolume* hcal::fScTile
private

Calorimeter Modules.

Definition at line 214 of file hcal.h.

◆ fSemiX

Float_t hcal::fSemiX
private

Semiaxises of keeping volume for ecal

Definition at line 154 of file hcal.h.

◆ fSemiY

Float_t hcal::fSemiY
private

Definition at line 155 of file hcal.h.

◆ fSimpleGeo

Int_t hcal::fSimpleGeo
private

Use simple geometry. Try to be as compatible to hcal in physics as possible

Definition at line 140 of file hcal.h.

◆ fSteelTapes

TGeoVolume* hcal::fSteelTapes[2]
private

Fiber volume.

Definition at line 220 of file hcal.h.

◆ fStructureId

Int_t hcal::fStructureId
private

List of constructed raws.

Volume ID of calorimeter structure

Definition at line 226 of file hcal.h.

◆ fThicknessAbsorber

Float_t hcal::fThicknessAbsorber
private

thickness of one lead layer [cm]

Definition at line 159 of file hcal.h.

◆ fThicknessLayer

Float_t hcal::fThicknessLayer
private

total thickness of one layer [cm]

Definition at line 165 of file hcal.h.

◆ fThicknessScin

Float_t hcal::fThicknessScin
private

thickness of one scintillator layer [cm]

Definition at line 161 of file hcal.h.

◆ fThicknessSteel

Float_t hcal::fThicknessSteel
private

total thickness of steel layer [cm]

Definition at line 167 of file hcal.h.

◆ fThicknessTyvk

Float_t hcal::fThicknessTyvk
private

thickness of one tyvek layer [cm]

Definition at line 163 of file hcal.h.

◆ fTileEdging

TGeoVolume* hcal::fTileEdging
private

Pb tiles.

Definition at line 215 of file hcal.h.

◆ fTime

Double32_t hcal::fTime
private

time

Definition at line 123 of file hcal.h.

◆ fTrackID

Int_t hcal::fTrackID
private

Track information to be stored until the track leaves the active volume. track index

Definition at line 115 of file hcal.h.

◆ fTvTile

TGeoVolume* hcal::fTvTile
private

Scintillator tiles.

Definition at line 217 of file hcal.h.

◆ fVolArr

Int_t hcal::fVolArr[kNumberOfHCALSensitiveVolumes]
private

Map of volumes in HCAL fVolArr[0]==code of sensivite wall fVolArr[4]==code of Lead fVolArr[3]==code of Tyveec fVolArr[5]==code of scintillator

Definition at line 200 of file hcal.h.

◆ fVolIdMax

Int_t hcal::fVolIdMax
private

Max number of HCAL cells

Definition at line 191 of file hcal.h.

◆ fVolumeID

Int_t hcal::fVolumeID
private

volume id

Definition at line 117 of file hcal.h.

◆ fXCell

Float_t hcal::fXCell
private

XY Size of cell

Definition at line 175 of file hcal.h.

◆ fXSize

Int_t hcal::fXSize
private

Size of the HCAL in modules

Definition at line 144 of file hcal.h.

◆ fYCell

Float_t hcal::fYCell
private

Definition at line 176 of file hcal.h.

◆ fYSize

Int_t hcal::fYSize
private

Definition at line 145 of file hcal.h.

◆ fZHcal

Float_t hcal::fZHcal
private

Z-position of HCAL from the target [cm]

Definition at line 152 of file hcal.h.


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