@@ -73,20 +73,20 @@ bool Detector::ProcessHits(FairVolume* v)
7373 Int_t volID = fMC ->CurrentVolID (copy);
7474 auto stack = (o2::data::Stack*)fMC ->GetStack ();
7575
76- // Treat photons
77- // photon (Ckov or feedback) hits on module PC (Hpad)
76+ // Treat photons
77+ // photon (Ckov or feedback) hits on module PC (Hpad)
7878 if ((fMC ->TrackPid () == 50000050 || fMC ->TrackPid () == 50000051 ) && (volID == mHpad0VolID || volID == mHpad1VolID || volID == mHpad2VolID || volID == mHpad3VolID || volID == mHpad4VolID || volID == mHpad5VolID || volID == mHpad6VolID )) {
79- if (fMC ->Edep () > 0 ) { // photon survided QE test i.e. produces electron
79+ if (fMC ->Edep () > 0 ) { // photon survided QE test i.e. produces electron
8080 if (IsLostByFresnel ()) {
8181 fMC ->StopTrack ();
8282 return false ;
83- } // photon lost due to fersnel reflection on PC
84- Int_t tid = fMC ->GetStack ()->GetCurrentTrackNumber (); // take TID
85- Int_t pid = fMC ->TrackPid (); // take PID
86- Float_t etot = fMC ->Etot (); // total hpoton energy, [GeV]
83+ } // photon lost due to fersnel reflection on PC
84+ Int_t tid = fMC ->GetStack ()->GetCurrentTrackNumber (); // take TID
85+ Int_t pid = fMC ->TrackPid (); // take PID
86+ Float_t etot = fMC ->Etot (); // total hpoton energy, [GeV]
8787 Double_t x[3 ];
88- fMC ->TrackPosition (x[0 ], x[1 ], x[2 ]); // take MARS position at entrance to PC
89- Float_t hitTime = (Float_t)fMC ->TrackTime (); // hit formation time
88+ fMC ->TrackPosition (x[0 ], x[1 ], x[2 ]); // take MARS position at entrance to PC
89+ Float_t hitTime = (Float_t)fMC ->TrackTime (); // hit formation time
9090 Int_t idch; // chamber number
9191 if (volID == mHpad0VolID ) {
9292 idch = 0 ;
@@ -104,20 +104,20 @@ bool Detector::ProcessHits(FairVolume* v)
104104 idch = 6 ;
105105 }
106106 Double_t xl, yl;
107- o2::hmpid::Param::instance ()->mars2Lors (idch, x, xl, yl); // take LORS position
108- AddHit (x[0 ], x[1 ], x[2 ], hitTime, etot, tid, idch); // HIT for photon, position at P, etot will be set to Q
109- GenFee (etot); // generate feedback photons etot is modified in hit ctor to Q of hit
107+ o2::hmpid::Param::instance ()->mars2Lors (idch, x, xl, yl); // take LORS position
108+ AddHit (x[0 ], x[1 ], x[2 ], hitTime, etot, tid, idch); // HIT for photon, position at P, etot will be set to Q
109+ GenFee (etot); // generate feedback photons etot is modified in hit ctor to Q of hit
110110 stack->addHit (GetDetId ());
111- } // photon hit PC and DE >0
111+ } // photon hit PC and DE >0
112112 return kTRUE ;
113- } // photon hit PC
113+ } // photon hit PC
114114
115- // Treat charged particles
116- static Float_t eloss; // need to store mip parameters between different steps
115+ // Treat charged particles
116+ static Float_t eloss; // need to store mip parameters between different steps
117117 static Double_t in[3 ];
118118
119119 if (fMC ->IsTrackEntering () && fMC ->TrackCharge () && (volID == mHpad0VolID || volID == mHpad1VolID || volID == mHpad2VolID || volID == mHpad3VolID || volID == mHpad4VolID || volID == mHpad5VolID || volID == mHpad6VolID )) {
120- // Trackref stored when entering in the pad volume
120+ // Trackref stored when entering in the pad volume
121121 o2::TrackReference tr (*fMC , GetDetId ());
122122 tr.setTrackID (stack->GetCurrentTrackNumber ());
123123 // tr.setUserId(lay);
@@ -126,18 +126,18 @@ bool Detector::ProcessHits(FairVolume* v)
126126
127127 if (fMC ->TrackCharge () && (volID == mHcel0VolID || volID == mHcel1VolID || volID == mHcel2VolID || volID == mHcel3VolID || volID == mHcel4VolID || volID == mHcel5VolID || volID == mHcel6VolID )) {
128128 // charged particle in amplification gap (Hcel)
129- if (fMC ->IsTrackEntering () || fMC ->IsNewTrack ()) { // entering or newly created
130- eloss = 0 ; // reset Eloss collector
131- fMC ->TrackPosition (in[0 ], in[1 ], in[2 ]); // take position at the entrance
132- } else if (fMC ->IsTrackExiting () || fMC ->IsTrackStop () || fMC ->IsTrackDisappeared ()) { // exiting or disappeared
133- eloss += fMC ->Edep (); // take into account last step Eloss
134- Int_t tid = fMC ->GetStack ()->GetCurrentTrackNumber (); // take TID
135- Int_t pid = fMC ->TrackPid (); // take PID
129+ if (fMC ->IsTrackEntering () || fMC ->IsNewTrack ()) { // entering or newly created
130+ eloss = 0 ; // reset Eloss collector
131+ fMC ->TrackPosition (in[0 ], in[1 ], in[2 ]); // take position at the entrance
132+ } else if (fMC ->IsTrackExiting () || fMC ->IsTrackStop () || fMC ->IsTrackDisappeared ()) { // exiting or disappeared
133+ eloss += fMC ->Edep (); // take into account last step Eloss
134+ Int_t tid = fMC ->GetStack ()->GetCurrentTrackNumber (); // take TID
135+ Int_t pid = fMC ->TrackPid (); // take PID
136136 Double_t out[3 ];
137- fMC ->TrackPosition (out[0 ], out[1 ], out[2 ]); // take MARS position at exit
138- Float_t hitTime = (Float_t)fMC ->TrackTime (); // hit formation time
137+ fMC ->TrackPosition (out[0 ], out[1 ], out[2 ]); // take MARS position at exit
138+ Float_t hitTime = (Float_t)fMC ->TrackTime (); // hit formation time
139139 out[0 ] = 0.5 * (out[0 ] + in[0 ]); //
140- out[1 ] = 0.5 * (out[1 ] + in[1 ]); // take hit position at the anod plane
140+ out[1 ] = 0.5 * (out[1 ] + in[1 ]); // take hit position at the anod plane
141141 out[2 ] = 0.5 * (out[2 ] + in[2 ]);
142142 Int_t idch; // chamber number
143143 if (volID == mHcel0VolID ) {
@@ -156,20 +156,20 @@ bool Detector::ProcessHits(FairVolume* v)
156156 idch = 6 ;
157157 }
158158 Double_t xl, yl;
159- o2::hmpid::Param::instance ()->mars2Lors (idch, out, xl, yl); // take LORS position
159+ o2::hmpid::Param::instance ()->mars2Lors (idch, out, xl, yl); // take LORS position
160160 if (eloss > 0 ) {
161161 // HIT for MIP, position near anod plane, eloss will be set to Q
162162 AddHit (out[0 ], out[1 ], out[2 ], hitTime, eloss, tid, idch);
163- GenFee (eloss); // generate feedback photons
163+ GenFee (eloss); // generate feedback photons
164164 stack->addHit (GetDetId ());
165165 eloss = 0 ;
166166 }
167167 } else {
168- // just going inside
169- eloss += fMC ->Edep (); // collect this step eloss
168+ // just going inside
169+ eloss += fMC ->Edep (); // collect this step eloss
170170 }
171171 return kTRUE ;
172- } // MIP in GAP
172+ } // MIP in GAP
173173
174174 // later on return true if there was a hit!
175175 return false ;
@@ -187,14 +187,14 @@ void Detector::GenFee(Float_t qtot)
187187 // eloss=0 means photon so only pulse height distribution is to be analysed.
188188 TLorentzVector x4;
189189 fMC ->TrackPosition (x4);
190- Int_t iNphotons = fMC ->GetRandom ()->Poisson (0.02 * qtot); // # of feedback photons is proportional to the charge of hit
191- // AliDebug(1,Form("N photons=%i",iNphotons));
190+ Int_t iNphotons = fMC ->GetRandom ()->Poisson (0.02 * qtot); // # of feedback photons is proportional to the charge of hit
191+ // AliDebug(1,Form("N photons=%i",iNphotons));
192192 Int_t j;
193193 Float_t cthf, phif, enfp = 0 , sthf, e1 [3 ], e2 [3 ], e3 [3 ], vmod, uswop, dir[3 ], phi, pol[3 ], mom[4 ];
194- // Generate photons
195- for (Int_t i = 0 ; i < iNphotons; i++) { // feedbacks loop
194+ // Generate photons
195+ for (Int_t i = 0 ; i < iNphotons; i++) { // feedbacks loop
196196 Double_t ranf[2 ];
197- fMC ->GetRandom ()->RndmArray (2 , ranf); // Sample direction
197+ fMC ->GetRandom ()->RndmArray (2 , ranf); // Sample direction
198198 cthf = ranf[0 ] * 2 - 1.0 ;
199199 if (cthf < 0 ) {
200200 continue ;
@@ -276,8 +276,8 @@ void Detector::GenFee(Float_t qtot)
276276 }
277277 fMC ->Gdtom (pol, pol, 2 );
278278 Int_t outputNtracksStored;
279- } // feedbacks loop
280- } // GenerateFeedbacks()
279+ } // feedbacks loop
280+ } // GenerateFeedbacks()
281281// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
282282Bool_t Detector::IsLostByFresnel ()
283283{
@@ -301,7 +301,7 @@ Bool_t Detector::IsLostByFresnel()
301301 } else {
302302 return kFALSE ;
303303 }
304- } // IsLostByFresnel()
304+ } // IsLostByFresnel()
305305// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
306306Float_t Detector::Fresnel (Float_t ene, Float_t pdoti, Bool_t pola)
307307{
@@ -325,8 +325,8 @@ Float_t Detector::Fresnel(Float_t ene, Float_t pdoti, Bool_t pola)
325325 Float_t cn = csin[j] + ((csin[j + 1 ] - csin[j]) / 0.1 ) * (xe - en[j]);
326326 Float_t ck = csik[j] + ((csik[j + 1 ] - csik[j]) / 0.1 ) * (xe - en[j]);
327327
328- // FORMULAE FROM HANDBOOK OF OPTICS, 33.23 OR
329- // W.R. HUNTER, J.O.S.A. 54 (1964),15 , J.O.S.A. 55(1965),1197
328+ // FORMULAE FROM HANDBOOK OF OPTICS, 33.23 OR
329+ // W.R. HUNTER, J.O.S.A. 54 (1964),15 , J.O.S.A. 55(1965),1197
330330
331331 Float_t sinin = TMath::Sqrt ((1 . - pdoti) * (1 . + pdoti));
332332 Float_t tanin = sinin / pdoti;
@@ -340,8 +340,8 @@ Float_t Detector::Fresnel(Float_t ene, Float_t pdoti, Bool_t pola)
340340 Float_t rp = rs * ((aO - sinin * tanin) * (aO - sinin * tanin) + b2) /
341341 ((aO + sinin * tanin) * (aO + sinin * tanin) + b2);
342342
343- // CORRECTION FACTOR FOR SURFACE ROUGHNESS
344- // B.J. STAGG APPLIED OPTICS, 30(1991),4113
343+ // CORRECTION FACTOR FOR SURFACE ROUGHNESS
344+ // B.J. STAGG APPLIED OPTICS, 30(1991),4113
345345
346346 Float_t sigraf = 18 .;
347347 Float_t lamb = 1240 / ene;
@@ -351,15 +351,15 @@ Float_t Detector::Fresnel(Float_t ene, Float_t pdoti, Bool_t pola)
351351 (4 * TMath::Pi () * pdoti * sigraf / lamb));
352352
353353 if (pola) {
354- Float_t pdotr = 0.8 ; // DEGREE OF POLARIZATION : 1->P , -1->S
354+ Float_t pdotr = 0.8 ; // DEGREE OF POLARIZATION : 1->P , -1->S
355355 fresn = 0.5 * (rp * (1 + pdotr) + rs * (1 - pdotr));
356356 } else {
357357 fresn = 0.5 * (rp + rs);
358358 }
359359
360360 fresn = fresn * rO;
361361 return fresn;
362- } // Fresnel()
362+ } // Fresnel()
363363// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
364364void Detector::Register () { FairRootManager::Instance ()->RegisterAny (addNameTo (" Hit" ).data (), mHits , true ); }
365365
@@ -537,7 +537,15 @@ void Detector::createMaterials()
537537 Material (++matId, " Ar" , aAr, zAr, dAr, radAr, absAr);
538538 Medium (kAr , " Ar" , matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
539539}
540-
540+ // **************************************************************************************************
541+ TGeoVolume* Detector::createAbsorber (float tickness)
542+ {
543+ double cm = 1 , mm = 0.1 * cm, um = 0.001 * mm; // default is cm
544+ auto & matmgr = o2::base::MaterialManager::Instance ();
545+ TGeoMedium* al = matmgr.getTGeoMedium (" HMP_Al" );
546+ TGeoVolume* abs = gGeoManager ->MakeBox (" Habs" , al, tickness * mm / 2 , 1300.00 * mm / 2 , 1300 * mm / 2 );
547+ return abs;
548+ }
541549// **************************************************************************************************
542550
543551TGeoVolume* Detector::createChamber (int number)
@@ -1252,6 +1260,25 @@ void Detector::ConstructGeometry()
12521260
12531261 TGeoVolume* hmpcradle = CreateCradle ();
12541262
1263+ TGeoVolume* hmpidabs_cham2 = createAbsorber (40.0 );
1264+ TGeoVolume* hmpidabs_cham4 = createAbsorber (80.0 );
1265+
1266+ double theta = 33.5 ;
1267+
1268+ TGeoHMatrix* pMatrixAbs2 = new TGeoHMatrix;
1269+ const double trans2[] = {435.5 , 0 ., -155 .};
1270+ pMatrixAbs2->SetTranslation (trans2);
1271+ pMatrixAbs2->RotateZ (theta);
1272+
1273+ gGeoManager ->GetVolume (" barrel" )->AddNode (hmpidabs_cham2, 0 , pMatrixAbs2);
1274+
1275+ TGeoHMatrix* pMatrixAbs4 = new TGeoHMatrix;
1276+ const double trans4[] = {435 ., 0 ., 155 .};
1277+ pMatrixAbs4->SetTranslation (trans4);
1278+ pMatrixAbs4->RotateZ (theta);
1279+
1280+ gGeoManager ->GetVolume (" barrel" )->AddNode (hmpidabs_cham4, 0 , pMatrixAbs4);
1281+
12551282 for (Int_t iCh = 0 ; iCh <= 6 ; iCh++) { // place 7 chambers
12561283 TGeoVolume* hmpid = createChamber (iCh);
12571284 TGeoHMatrix* pMatrix = new TGeoHMatrix;
0 commit comments