1 // **************************************************************************
2 // * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 // * Author: The ALICE Off-line Project. *
5 // * Contributors are mentioned in the code where appropriate. *
7 // * Permission to use, copy, modify and distribute this software and its *
8 // * documentation strictly for non-commercial purposes is hereby granted *
9 // * without fee, provided that the above copyright notice appears in all *
10 // * copies and that both the copyright notice and this permission notice *
11 // * appear in the supporting documentation. The authors make no claims *
12 // * about the suitability of this software for any purpose. It is *
13 // * provided "as is" without express or implied warranty. *
14 // **************************************************************************
18 #include <TArrayD.h> //new constructor
20 #include <TGeoManager.h>
21 #include <TGeoVolume.h> //CreateGeometry()
22 #include <TGeoMatrix.h>
23 #include <TVirtualMC.h> //->gMC in StepManager
24 #include <TPDGCode.h> //StepHistory
25 #include <TClonesArray.h>
26 #include <TGeoGlobalMagField.h>
27 #include "AliRun.h" //CreateMaterials()
28 #include "AliMC.h" //CreateMaterials()
29 #include "AliMagF.h" //CreateMaterials()
30 #include "AliCDBManager.h" //CreateMaterials()
31 #include "AliCDBEntry.h" //CreateMaterials()
32 #include "AliITSupgrade.h" //class header
33 #include "AliITShit.h" // StepManager()
34 #include "AliITSDigitUpgrade.h"
35 #include "AliTrackReference.h" // StepManager()
36 #include "AliITSDetTypeSim.h"
37 ClassImp(AliITSupgrade)
38 //__________________________________________________________________________________________________
39 AliITSupgrade::AliITSupgrade():
62 //__________________________________________________________________________________________________
63 AliITSupgrade::AliITSupgrade(const char *name,const char *title, Bool_t isBeamPipe):
71 fBeampipe(isBeamPipe),
82 fWidths.Set(fNlayers);
84 fRadiiCu.Set(fNlayers);
85 fWidthsCu.Set(fNlayers);
86 fCopper.Set(fNlayers);
87 fHalfLength.Set(fNlayers);
89 // Default values are used in order to simulate the standard ITS material budget (see The ALICE Collaboration et al 2008 JINST 3 S08002 - Figure 3.2).
90 // The cell segmentation is chosen to achieve the tracking resolution as described in Table 3.2 of The ALICE Collaboration et al 2008 JINST 3 S08002,
91 // apart from SPD0 where the 9 um value is considered : resolution*sqrt(12)
92 // Cilinder lenghts are chosen according to Table 1 of the Alignment paper : http://iopscience.iop.org/1748-0221/5/03/P03003
94 Double_t xsz[6]={31.18*1e-04,41.6*1e-04,131.6*1e-04,131.6*1e-04,69.3*1e-04,69.3*1e-04};
95 Double_t zsz[6]={416*1e-04,416*1e-04,97*1e-04,97*1e-04,2875*1e-04,2875*1e-04};
96 Double_t Lhalf[6]={14.1,14.1,22.2,29.7,43.1,48.9};
97 Double_t r[6]={4.,7.6,14.9,23.8,39.1,43.6};
98 Double_t thick[6]={75.*1e-04,150.*1e-04,150.*1e-04,150.*1e-04,150.*1e-04,150.*1e-04};
101 TArrayD xsizeSi(nlayers);
102 TArrayD zsizeSi(nlayers);
104 // adding beam pipe upgrade
108 fHalfLengthBP = Lhalf[0];
111 // setting the geonetry parameters and the segmentation
112 Int_t npixHalf[6], npixR[6];
113 Double_t HalfL[6], xszInt[6];
114 Int_t c[6]={1,1,1,1,1,1};
116 for(Int_t i=0; i<nlayers; i++){
118 npixHalf[i]=(Int_t)(Lhalf[i]/zsz[i]);
119 HalfL[i]=npixHalf[i]*zsz[i];
120 // recalc segmentation
121 npixR[i] = (Int_t)(2*TMath::Pi()*r[i]/xsz[i]);
122 xszInt[i]= 2*TMath::Pi()*r[i]/npixR[i];
123 xsizeSi.AddAt(xszInt[i],i);
124 zsizeSi.AddAt(zsz[i],i);
126 fHalfLength.AddAt(HalfL[i],i);
128 fRadii.AddAt(r[i],i);
129 fWidths.AddAt(thick[i],i);
131 fRadiiCu.AddAt(r[i]+thick[i],i);
132 fWidthsCu.AddAt(0.015,i);//micron
133 fCopper.AddAt(c[i],i);
136 SetFullSegmentation(xsizeSi,zsizeSi);
138 //__________________________________________________________________________________________________
139 AliITSupgrade::AliITSupgrade(const char *name,const char *title, TArrayD widths, TArrayD radii,TArrayD halfLengths, TArrayD radiiCu, TArrayD widthsCu, TArrayS copper,Bool_t bp,Double_t radiusBP, Double_t widthBP, Double_t halfLengthBP):
151 fNlayers(widths.GetSize()),
152 fHalfLength(halfLengths),
160 for(Int_t i=0;i<fNlayers;i++){
162 fWidths.AddAt(widths.At(i),i);
164 fRadii.AddAt(radii.At(i),i);
165 AliDebug(1,"Creating Volume");
171 fHalfLengthBP=halfLengthBP;
177 AliITSupgrade::~AliITSupgrade(){
179 if(fSdigits) {fSdigits->Delete(); delete fSdigits;}
180 if(fDigits) {fDigits->Delete(); delete fDigits;}
185 //_________________________________________________________________________________________________
186 void AliITSupgrade::AddAlignableVolumes()const
192 //__________________________________________________________________________________________________
194 void AliITSupgrade::CreateMaterials()
197 // Definition of ITS materials
200 AliInfo("Start ITS materials");
201 //data from PDG booklet 2002 density [gr/cm^3] rad len [cm] abs len [cm]
202 Float_t aAir[4]={12,14,16,36} , zAir[4]={6,7,8,18} , wAir[4]={0.000124,0.755267,0.231781,0.012827} , dAir=0.00120479; Int_t nAir=4;//mixture
203 Float_t aBe = 9.012 , zBe = 4 , dBe = 1.848 , radBe = 65.19/dBe , absBe = 77.8/dBe ; // UPGRADE -> beryllium beampipe
204 Float_t aSi = 28.085 , zSi = 14 , dSi = 2.329 , radSi = 21.82/dSi , absSi = 108.4/dSi ; // UPGRADE -> Si tube
205 Float_t aCu = 63.54, zCu = 29 , dCu= 8.96 , radCu = 12.86/dCu, absCu= 137.3/dCu;//Upgrade -> Copper Tube
207 Int_t matId=0; //tmp material id number
208 Int_t unsens = 0, sens=1; //sensitive or unsensitive medium
209 Int_t itgfld = 3; //type of field intergration 0 no field -1 user in guswim 1 Runge Kutta 2 helix 3 const field along z
210 Float_t maxfld = 5.; //max field value
211 Float_t tmaxfd = -10.0; //max deflection angle due to magnetic field in one step
212 Float_t deemax = - 0.2; //max fractional energy loss in one step
213 Float_t stemax = - 0.1; //max step allowed [cm]
214 Float_t epsil = 0.001; //abs tracking precision [cm]
215 Float_t stmin = - 0.001; //min step size [cm] in continius process transport, negative value: choose it automatically
216 Float_t tmaxfdSi = 0.1; // .10000E+01; // Degree
217 Float_t stemaxSi = 0.0075; // .10000E+01; // cm
218 Float_t deemaxSi = 0.1; // 0.30000E-02; // Fraction of particle's energy 0<deemax<=1
219 Float_t epsilSi = 1.0E-4;// .10000E+01;
220 Float_t stminSi = 0.0; // cm "Default value used"
222 Float_t epsilBe = .001; // Tracking precision,
223 Float_t stemaxBe = -0.01; // Maximum displacement for multiple scat
224 Float_t tmaxfdBe = -20.; // Maximum angle due to field deflection
225 Float_t deemaxBe = -.3; // Maximum fractional energy loss, DLS
226 Float_t stminBe = -.8;
227 Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();//from CreateMaterials in STRUCT/AliPIPEv3.cxx
228 Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();//from CreateMaterials in STRUCT/AliPIPEv3.cxx
231 AliMixture(++matId,"UpgradeAir" ,aAir ,zAir ,dAir ,nAir ,wAir );
232 AliMedium(kAir ,"UpgradeAir" ,matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
234 AliMaterial(++matId,"UpgradeSi" ,aSi ,zSi ,dSi ,radSi ,absSi );
235 AliMedium(kSi ,"UpgradeSi" , matId, sens, itgfld, maxfld, tmaxfdSi, stemaxSi, deemaxSi, epsilSi, stminSi);
237 AliMaterial(++matId,"UpgradeBe" ,aBe ,zBe ,dBe ,radBe ,absBe );
238 AliMedium(kBe ,"UpgradeBe" , matId, unsens, isxfld, sxmgmx, tmaxfdBe, stemaxBe, deemaxBe, epsilBe, stminBe);
240 AliMaterial(++matId, "UpgradeCu", aCu, zCu, dCu, radCu, absCu);
241 AliMedium(kCu, "UpgradeCu", matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
243 AliInfo("End ITS materials");
245 }//void AliITS::CreateMaterials()
246 //__________________________________________________________________________________________________
247 void AliITSupgrade::CreateGeometry()
250 //Creates detailed geometry simulation (currently GEANT volumes tree)
252 AliInfo("Start ITS upgrade preliminary version building");
253 if(!gMC->IsRootGeometrySupported()) return;
254 TGeoVolumeAssembly *vol= CreateVol();
255 gGeoManager->GetVolume("ALIC")->AddNode(vol,0);
256 AliInfo("Stop ITS upgrade preliminary version building");
259 //__________________________________________________________________________________________________
260 void AliITSupgrade::StepManager()
262 // Full Step Manager.
265 // StepHistory(); return; //uncomment to print tracks history
266 // StepCount(); return; //uncomment to count photons
268 if(!fSegmentation) AliFatal("No segmentation available");
270 if(!(this->IsActive())) return;
271 if(!(gMC->TrackCharge())) return;
272 TString volumeName=gMC->CurrentVolName();
273 if(volumeName.Contains("Be")) return;
274 if(volumeName.Contains("Cu")) return;
275 if(gMC->IsTrackExiting()) {
276 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kITS);
277 } // if Outer ITS mother Volume
279 static TLorentzVector position, momentum; // Saves on calls to construtors
280 static AliITShit hit;// Saves on calls to constructors
287 if(gMC->IsTrackInside()) status += 1;
288 if(gMC->IsTrackEntering()) status += 2;
289 if(gMC->IsTrackExiting()) status += 4;
290 if(gMC->IsTrackOut()) status += 8;
291 if(gMC->IsTrackDisappeared()) status += 16;
292 if(gMC->IsTrackStop()) status += 32;
293 if(gMC->IsTrackAlive()) status += 64;
296 // Fill hit structure.
299 gMC->CurrentVolID(copy);
301 volumeName.Remove(0,12); // remove letters to get the layer number
302 hit.SetModule(fSegmentation->GetIdIndex(volumeName.Atoi(),copy)); // layer and sector information are together in the IdIndex (if copy=0 the idIndex is the layer));
303 hit.SetTrack(gAlice->GetMCApp()->GetCurrentTrackNumber());
305 gMC->TrackPosition(position);
306 gMC->TrackMomentum(momentum);
307 hit.SetPosition(position);
309 hit.SetTime(gMC->TrackTime());
310 hit.SetMomentum(momentum);
311 hit.SetStatus(status);
312 hit.SetEdep(gMC->Edep());
313 hit.SetShunt(GetIshunt());
314 if(gMC->IsTrackEntering()){
315 hit.SetStartPosition(position);
316 hit.SetStartTime(gMC->TrackTime());
317 hit.SetStartStatus(status);
318 return; // don't save entering hit.
320 // Fill hit structure with this new hit.
322 new((*fHits)[fNhits++]) AliITShit(hit); // Use Copy Construtor.
323 // Save old position... for next hit.
324 hit.SetStartPosition(position);
325 hit.SetStartTime(gMC->TrackTime());
326 hit.SetStartStatus(status);
330 //__________________________________________________________________________________________________
331 TGeoVolumeAssembly * AliITSupgrade::CreateVol()
334 TGeoVolumeAssembly *vol = new TGeoVolumeAssembly("ITSupgrade");
335 TGeoMedium *si =gGeoManager->GetMedium("ITS_UpgradeSi");
336 TGeoMedium *cu =gGeoManager->GetMedium("ITS_UpgradeCu");
337 TGeoMedium *be =gGeoManager->GetMedium("ITS_UpgradeBe");
338 for(Int_t ivol=0;ivol<fNlayers;ivol++){
341 TGeoVolume *layer=gGeoManager->MakeTube(Form("LayerSilicon%i",ivol),si , fRadii.At(ivol) , fRadii.At(ivol)+fWidths.At(ivol) , fHalfLength.At(ivol)); //upgraded situation
343 TGeoVolume *layerCu=gGeoManager->MakeTube(Form("LayerCu%i",ivol),cu , fRadiiCu.At(ivol) , fRadiiCu.At(ivol)+fWidthsCu.At(ivol) , fHalfLength.At(ivol) ); //upgraded situation
345 vol ->AddNode(layer,ivol);
346 if(fCopper.At(ivol)){
347 vol->AddNode(layerCu,ivol);
352 TGeoVolume *layer = gGeoManager->MakeTubs(Form("LayerSilicon%i",ivol),si, fRadii.At(ivol), fRadii.At(ivol)+fWidths.At(ivol) ,fHalfLength.At(ivol),0,(360./fNSectors));
353 TGeoVolume *layerCu = gGeoManager->MakeTubs(Form("LayerCu%i",ivol),cu , fRadiiCu.At(ivol) , fRadiiCu.At(ivol)+fWidthsCu.At(ivol) , fHalfLength.At(ivol) ,0,(360./fNSectors));
356 for(Int_t i=0;i<fNSectors;i++){
357 TGeoRotation *rot1 = new TGeoRotation(" ",0.0,0.0,360.*i/fNSectors);//sector rotation
358 TGeoRotation *rot2 = new TGeoRotation(" ",0.0,0.0,360.*i/fNSectors);//
359 vol->AddNode(layer,i,rot1);
360 if(fCopper.At(ivol)){
361 vol->AddNode(layerCu,i,rot2);
369 TGeoVolume *beampipe=gGeoManager->MakeTube("BeamPipe", be , fRadiusBP , fRadiusBP+ fWidthBP , fHalfLengthBP ); //upgraded situation
370 vol->AddNode(beampipe,0);
376 //_________________________________________________________________________________________________
377 void AliITSupgrade::SetFullSegmentation(TArrayD xsize,TArrayD zsize){
380 for(Int_t lay = 0; lay< xsize.GetSize(); lay++){
381 Double_t arch = fRadii.At(lay)*(TMath::Pi()*2/fNSectors);
382 Int_t nPixRPhi = (Int_t)(arch/xsize.At(lay));
383 Int_t nPixZed = (Int_t)((2*fHalfLength.At(lay))/zsize.At(lay));
384 if(nPixRPhi>9999)Check=kTRUE;
385 if(nPixZed>99999)Check=kTRUE;
387 if(Check) AliFatal(" Segmentation is too small!! ");
388 if(fSegmentation) fSegmentation->SetNSectors(fNSectors);
390 nSect.AddAt(fNSectors,0);
391 TFile *file= TFile::Open("Segmentation.root","recreate");
392 file->WriteObjectAny(&xsize,"TArrayD","CellSizeX");
393 file->WriteObjectAny(&zsize,"TArrayD","CellSizeZ");
394 file->WriteObjectAny(&nSect,"TArrayD","nSectors");
397 //_________________________________________________________________________________________________
398 void AliITSupgrade::StepHistory()
400 // This methode is invoked from StepManager() in order to print out
402 const char *sParticle;
403 switch(gMC->TrackPid()){
404 case kProton: sParticle="PROTON" ;break;
405 case kNeutron: sParticle="neutron" ;break;
406 case kGamma: sParticle="gamma" ;break;
407 case kPi0: sParticle="Pi0" ;break;
408 case kPiPlus: sParticle="Pi+" ;break;
409 case kPiMinus: sParticle="Pi-" ;break;
410 case kElectron: sParticle="electron" ;break;
411 default: sParticle="not known" ;break;
414 TString flag="fanny combination";
415 if(gMC->IsTrackAlive())
416 if(gMC->IsTrackEntering()) flag="enters to";
417 else if(gMC->IsTrackExiting()) flag="exits from";
418 else if(gMC->IsTrackInside()) flag="inside";
419 else if(gMC->IsTrackStop()) flag="stopped in";
422 TString path=gMC->CurrentVolName(); path.Prepend("-");path.Prepend(gMC->CurrentVolOffName(1));//current volume and his mother are always there
423 vid=gMC->CurrentVolOffID(2,copy); if(vid) {path.Prepend("-");path.Prepend(gMC->VolName(vid));}
424 vid=gMC->CurrentVolOffID(3,copy); if(vid) {path.Prepend("-");path.Prepend(gMC->VolName(vid));}
426 AliDebug(10, Form("Step %i: %s (%i) %s %s m=%.6f GeV q=%.1f dEdX=%.4f Etot=%.4f",iStepN,sParticle,gMC->TrackPid(),flag.Data(),path.Data(),gMC->TrackMass(),gMC->TrackCharge(),gMC->Edep()*1e9,gMC->Etot()));
428 Double_t gMcTrackPos[3]; gMC->TrackPosition(gMcTrackPos[0],gMcTrackPos[1],gMcTrackPos[2]);
429 Double_t gMcTrackPosLoc[3]; gMC->Gmtod(gMcTrackPos,gMcTrackPosLoc,1);
430 AliDebug(10,Form("gMC Track Position (MARS) x: %5.3lf, y: %5.3lf, z: %5.3lf (r: %5.3lf) ---> (LOC) x: %5.3f, y: %5.3f, z: %5.3f",gMcTrackPos[0],gMcTrackPos[1],gMcTrackPos[2],TMath::Sqrt(gMcTrackPos[0]*gMcTrackPos[0]+gMcTrackPos[1]*gMcTrackPos[1]+gMcTrackPos[2]*gMcTrackPos[2]),gMcTrackPosLoc[0],gMcTrackPosLoc[1],gMcTrackPosLoc[2]));
433 AliDebug(10,Form("Step %i: tid=%i flags alive=%i disap=%i enter=%i exit=%i inside=%i out=%i stop=%i new=%i",
434 iStepN, gAlice->GetMCApp()->GetCurrentTrackNumber(),
435 gMC->IsTrackAlive(), gMC->IsTrackDisappeared(),gMC->IsTrackEntering(), gMC->IsTrackExiting(),
436 gMC->IsTrackInside(),gMC->IsTrackOut(), gMC->IsTrackStop(), gMC->IsNewTrack()));
438 Float_t a,z,den,rad,abs; a=z=den=rad=abs=-1;
439 Int_t mid=gMC->CurrentMaterial(a,z,den,rad,abs);
440 AliDebug(10, Form("Step %i: mid=%i a=%7.2f z=%7.2f den=%9.4f rad=%9.2f abs=%9.2f\n\n",iStepN,mid,a,z,den,rad,abs));
442 TArrayI proc; gMC->StepProcesses(proc);
443 AliDebug(1,"Processes in this step:");
444 for ( int i = 0 ; i < proc.GetSize(); i++)
446 AliDebug(10, Form("%s",TMCProcessName[proc.At(i)]));
448 AliDebug(1,"End process list");
451 //______________________________________________________
452 void AliITSupgrade::Hits2SDigits(){
454 // Interface method ivoked from AliSimulation to create a list of sdigits corresponding to list of hits. Every hit generates one or more sdigits.
457 AliDebug(1,"Start Hits2SDigits.");
459 if(!fSegmentation)fSegmentation=new AliITSsegmentationUpgrade();
461 if(!GetLoader()->TreeH()) {GetLoader()->LoadHits();}
462 if(!GetLoader()->TreeS())
464 for(Int_t iEvt=0;iEvt < GetLoader()->GetRunLoader()->GetNumberOfEvents();iEvt++){//events loop
465 GetLoader()->GetRunLoader()->GetEvent(iEvt); //get next event
467 GetLoader()->MakeTree("S");
471 Int_t nSdigit[10]; for(Int_t i=0;i<10;i++) nSdigit[i] =0;
472 for(Int_t iEnt=0;iEnt<GetLoader()->TreeH()->GetEntries();iEnt++){//prims loop
473 GetLoader()->TreeH()->GetEntry(iEnt);
474 Hit2SumDig(Hits(),SDigitsList(),nSdigit);//convert this hit to list of sdigits
476 GetLoader()->TreeS()->Fill();
477 GetLoader()->WriteSDigits("OVERWRITE");
480 GetLoader()->UnloadHits();
481 GetLoader()->UnloadSDigits();
482 AliDebug(1,"Stop Hits2SDigits.");
485 //____________________________
486 void AliITSupgrade::Hit2SumDig(TClonesArray *hits,TObjArray *pSDig, Int_t *nSdigit)
488 // Adds sdigits of this hit to the list
491 AliDebug(1,"Start Hit2SumDig");
495 AliDebug(1,"Segmentation Not inizialized!!");
499 TClonesArray *pSdigList[10];
501 for(Int_t i=0;i<fNlayers;i++){
502 pSdigList[i]=(TClonesArray*)(*pSDig)[i];
503 if(pSdigList[i]->GetEntries()!=0) AliErrorClass("Some of sdigits lists is not empty"); //in principle those lists should be empty
506 for(Int_t iHit=0;iHit<hits->GetEntries();iHit++){ //hits loop
507 AliITShit *hit = (AliITShit*)hits->At(iHit);
511 if(!fSegmentation->GlobalToDet(fSegmentation->GetLayerFromIdIndex(hit->GetModule()),hit->GetXG(),hit->GetYG(),hit->GetZG(),xz[0],xz[1],module)) continue;
512 AliITSDigitUpgrade digit;
513 digit.SetSignal(hit->GetIonization());
514 digit.SetNelectrons(hit->GetIonization()/(3.62*1e-09));
515 digit.SetLayer(fSegmentation->GetLayerFromIdIndex(hit->GetModule()));
516 digit.SetModule(fSegmentation->GetModuleFromIdIndex(hit->GetModule()));//set the module (=sector) of ITSupgrade
517 digit.SetTrackID(hit->GetTrack());
520 Int_t zpix = 999; // shift at the next line to have zpix always positive. Such numbers are used to build the Pixel Id in the layer (> 0!)
521 fSegmentation->DetToPixID(xz[0], xz[1],fSegmentation->GetLayerFromIdIndex(hit->GetModule()), xpix, zpix);
522 digit.SetPixId(xpix,zpix);
523 new((*pSdigList[fSegmentation->GetLayerFromIdIndex(hit->GetModule())])[nSdigit[fSegmentation->GetLayerFromIdIndex(hit->GetModule())]++]) AliITSDigitUpgrade(digit);
527 AliDebug(1,"Stop Hit2SumDig.");
529 //_______________________________________________________________________________________________
530 void AliITSupgrade::MakeBranch(Option_t *option){
531 //Create Tree branches
532 AliDebug(1,Form("Start with option= %s.",option));
534 const Int_t kBufSize = 4000;
536 const char *cH = strstr(option,"H");
537 const char *cD = strstr(option,"D");
538 //const char *cR = strstr(option,"R");
539 const char *cS = strstr(option,"S");
541 if(cH&&fLoader->TreeH()){
544 MakeBranchInTree(fLoader->TreeH(),"ITSupgrade",&fHits,kBufSize,0);
548 if(cS&&fLoader->TreeS()){
550 for(Int_t i=0;i<fNlayers;i++) MakeBranchInTree(fLoader->TreeS(),Form("Layer%d",i),&((*fSdigits)[i]),kBufSize,0);
554 if(cD&&fLoader->TreeD()){
556 for(Int_t i=0;i<fNlayers;i++) MakeBranchInTree(fLoader->TreeD(),Form("Layer%d",i),&((*fDigits)[i]),kBufSize,0);
560 //____________________________________________________________________________________________________
561 void AliITSupgrade::SetTreeAddress()
563 //Set branch address for the Hits and Digits Tree.
564 AliDebug(1,"Start.");
565 if(fLoader->TreeH() && fLoader->TreeH()->GetBranch("ITSupgrade" )){
567 fLoader->TreeH()->SetBranchAddress("ITSupgrade",&fHits);
571 if(fLoader->TreeS() && fLoader->TreeS()->GetBranch("Layer0" )){
573 for(int i=0;i<fNlayers;i++){
574 fLoader->TreeS()->SetBranchAddress(Form("Layer%d",i),&((*fSdigits)[i]));
578 if(fLoader->TreeD() && fLoader->TreeD()->GetBranch("Layer0")){
580 for(int i=0;i<fNlayers;i++){
581 fLoader->TreeD()->SetBranchAddress(Form("Layer%d",i),&((*fDigits)[i]));
586 //____________________________________________________________________________________________________
587 void AliITSupgrade::PrintSummary()
590 // pdg booklet or http://pdg.lbl.gov/2010/reviews/rpp2010-rev-atomic-nuclear-prop.pdf
592 // X0 as X0[g/cm^2]/density
593 Double_t beX0= 65.19/1.848;
594 Double_t cuX0= 12.86/8.96;
595 Double_t siX0= 21.82/2.329;
597 if(!fSegmentation) fSegmentation= new AliITSsegmentationUpgrade();
598 printf(" %10s %10s %10s %10s %10s %10s %10s %10s\n","Name","R [cm]","x/X0 [%]","Phi res[um]","Z res[um]","X segm[um]","Y segm[um]","widths [um]");
600 if(fBeampipe) printf(" Beampipe %10.3f %10f %10s %10s %10s %10s %10.1f\n", fRadiusBP, 100.*fWidthBP/beX0,"-","-","-","-",fWidthBP*1.e+4);
601 else printf(" * No Beam Pipe Upgrade \n");
602 for(Int_t i=0; i< fNlayers; i++){
603 printf(" Si Layer %1i %10.3f %10f %10.2f %10.2f %10.2f %10.2f %10.1f\n",i, fRadii.At(i), 100.*fWidths.At(i)/siX0, (fSegmentation->GetCellSizeX(i) *1.e+4)/TMath::Sqrt(12.), (fSegmentation->GetCellSizeZ(i)*1.e+4)/TMath::Sqrt(12.),fSegmentation->GetCellSizeX(i) *1.e+4, fSegmentation->GetCellSizeZ(i)*1.e+4,fWidths.At(i)*1.e+4);
604 printf(" Cu Layer %10.3f %10f %10s %10s %10s %10s %10.1f\n", fRadiiCu.At(i), 100.*fWidthsCu.At(i)/cuX0,"-","-","-","-",fWidthsCu.At(i)*1.e+4);
607 //____________________________________________________________________________________________________
608 void AliITSupgrade::SetSegmentationX(Double_t x, Int_t lay){
609 TFile *f = TFile::Open("Segmentation.root","UPDATE");
611 AliError("\n\n\n Segmentation.root file does not exist. The segmentation is 0! \n\n\n");
615 TArrayD *a = (TArrayD*)f->Get("CellSizeX");
617 AliError("CessSizeX array does not exist!");
621 f->WriteObjectAny(a,"TArrayD","CellSizeX");
626 //____________________________________________________________________________________________________
627 void AliITSupgrade::SetSegmentationZ(Double_t z, Int_t lay){
629 TFile *f = TFile::Open("Segmentation.root","UPDATE");
631 AliError("\n\n\n Segmentation.root file does not exist. The segmentation is 0! \n\n\n");
635 TArrayD *a = (TArrayD*)f->Get("CellSizeZ");
637 AliError("CellSizeZ array does not exist!");
641 f->WriteObjectAny(a,"TArrayD","CellSizeZ");