]>
Commit | Line | Data |
---|---|---|
d15a28e7 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
b2a60966 | 16 | /* $Id$ */ |
17 | ||
d15a28e7 | 18 | //_________________________________________________________________________ |
a5e00016 | 19 | //-- |
20 | //-- Yves Schutz (SUBATECH) | |
dfe0be07 | 21 | // Reconstruction class. Redesigned from the old AliReconstructionner class and |
22 | // derived from STEER/AliReconstructor. | |
23 | // | |
d15a28e7 | 24 | // --- ROOT system --- |
bb5c37a5 | 25 | #include "TGeoManager.h" |
26 | #include "TGeoMatrix.h" | |
00cfce1d | 27 | |
d15a28e7 | 28 | // --- Standard library --- |
364de5c6 | 29 | |
d15a28e7 | 30 | // --- AliRoot header files --- |
9a2cdbdf | 31 | #include "AliLog.h" |
b3006690 | 32 | #include "AliAltroMapping.h" |
af885e0f | 33 | #include "AliESDEvent.h" |
33ba95c3 | 34 | #include "AliESDCaloCluster.h" |
a5e00016 | 35 | #include "AliESDCaloCells.h" |
f444a19f | 36 | #include "AliPHOSReconstructor.h" |
7acf6008 | 37 | #include "AliPHOSClusterizerv1.h" |
7acf6008 | 38 | #include "AliPHOSTrackSegmentMakerv1.h" |
39 | #include "AliPHOSPIDv1.h" | |
23904d16 | 40 | #include "AliPHOSTracker.h" |
d22dd3b4 | 41 | #include "AliRawReader.h" |
d3aa2291 | 42 | #include "AliPHOSCalibData.h" |
7e88424f | 43 | #include "AliCDBEntry.h" |
44 | #include "AliCDBManager.h" | |
64df000d | 45 | #include "AliPHOSTrigger.h" |
46 | #include "AliPHOSGeometry.h" | |
9a2cdbdf | 47 | #include "AliPHOSDigit.h" |
48 | #include "AliPHOSTrackSegment.h" | |
49 | #include "AliPHOSEmcRecPoint.h" | |
50 | #include "AliPHOSRecParticle.h" | |
379c5c09 | 51 | #include "AliPHOSRawFitterv0.h" |
52 | #include "AliPHOSRawFitterv1.h" | |
53 | #include "AliPHOSRawFitterv2.h" | |
f4a5c5fd | 54 | #include "AliPHOSRawFitterv3.h" |
9a2cdbdf | 55 | #include "AliPHOSRawDigiProducer.h" |
56 | #include "AliPHOSPulseGenerator.h" | |
e957fea8 | 57 | |
f444a19f | 58 | ClassImp(AliPHOSReconstructor) |
d15a28e7 | 59 | |
2e60107f | 60 | Bool_t AliPHOSReconstructor::fgDebug = kFALSE ; |
6483babc | 61 | TClonesArray* AliPHOSReconstructor::fgDigitsArray = 0; // Array of PHOS digits |
62 | TObjArray* AliPHOSReconstructor::fgEMCRecPoints = 0; // Array of EMC rec.points | |
d3aa2291 | 63 | AliPHOSCalibData * AliPHOSReconstructor::fgCalibData = 0 ; |
64 | ||
2e60107f | 65 | |
d15a28e7 | 66 | //____________________________________________________________________________ |
9a2cdbdf | 67 | AliPHOSReconstructor::AliPHOSReconstructor() : |
dcab1c7e | 68 | fGeom(NULL),fClusterizer(NULL),fTSM(NULL),fPID(NULL) |
d15a28e7 | 69 | { |
b2a60966 | 70 | // ctor |
8d8258f6 | 71 | fGeom = AliPHOSGeometry::GetInstance("IHEP",""); |
dcab1c7e | 72 | fClusterizer = new AliPHOSClusterizerv1 (fGeom); |
73 | fTSM = new AliPHOSTrackSegmentMakerv1(fGeom); | |
74 | fPID = new AliPHOSPIDv1 (fGeom); | |
6483babc | 75 | fgDigitsArray = new TClonesArray("AliPHOSDigit",100); |
76 | fgEMCRecPoints= new TObjArray(100) ; | |
d3aa2291 | 77 | if (!fgCalibData) |
78 | fgCalibData = new AliPHOSCalibData(-1); //use AliCDBManager's run number | |
1d76a1f4 | 79 | |
80 | AliInfo(Form("PHOS bad channel map contains %d bad channel(s).\n", | |
81 | fgCalibData->GetNumOfEmcBadChannels())); | |
d3aa2291 | 82 | |
e68222ce | 83 | } |
6ad0bfa0 | 84 | |
0379a13e | 85 | //____________________________________________________________________________ |
86 | AliPHOSReconstructor::~AliPHOSReconstructor() | |
87 | { | |
88 | // dtor | |
9a2cdbdf | 89 | delete fGeom; |
8d8258f6 | 90 | delete fClusterizer; |
dcab1c7e | 91 | delete fTSM; |
92 | delete fPID; | |
6483babc | 93 | delete fgDigitsArray; |
94 | delete fgEMCRecPoints; | |
0379a13e | 95 | } |
7acf6008 | 96 | |
7acf6008 | 97 | //____________________________________________________________________________ |
9a2cdbdf | 98 | void AliPHOSReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const |
35293055 | 99 | { |
9a2cdbdf | 100 | // 'single-event' local reco method called by AliReconstruction; |
dfe0be07 | 101 | // Only the clusterization is performed,; the rest of the reconstruction is done in FillESD because the track |
af885e0f | 102 | // segment maker needs access to the AliESDEvent object to retrieve the tracks reconstructed by |
dfe0be07 | 103 | // the global tracking. |
9a2cdbdf | 104 | |
7e88424f | 105 | fClusterizer->InitParameters(); |
8d8258f6 | 106 | fClusterizer->SetInput(digitsTree); |
107 | fClusterizer->SetOutput(clustersTree); | |
a68156e6 | 108 | if ( Debug() ) |
8d8258f6 | 109 | fClusterizer->Digits2Clusters("deb all") ; |
a68156e6 | 110 | else |
8d8258f6 | 111 | fClusterizer->Digits2Clusters("") ; |
a68156e6 | 112 | } |
113 | ||
114 | //____________________________________________________________________________ | |
9a2cdbdf | 115 | void AliPHOSReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree, |
116 | AliESDEvent* esd) const | |
a68156e6 | 117 | { |
9a2cdbdf | 118 | // This method produces PHOS rec-particles, |
119 | // then it creates AliESDtracks out of them and | |
120 | // write tracks to the ESD | |
121 | ||
e68222ce | 122 | |
9a2cdbdf | 123 | // do current event; the loop over events is done by AliReconstruction::Run() |
dcab1c7e | 124 | fTSM->SetESD(esd) ; |
125 | fTSM->SetInput(clustersTree); | |
9a2cdbdf | 126 | if ( Debug() ) |
dcab1c7e | 127 | fTSM->Clusters2TrackSegments("deb all") ; |
9a2cdbdf | 128 | else |
dcab1c7e | 129 | fTSM->Clusters2TrackSegments("") ; |
35293055 | 130 | |
71994f35 | 131 | fPID->SetEnergyCorrectionOn(GetRecoParam()->GetEMCEnergyCorrectionOn()); |
132 | ||
dcab1c7e | 133 | fPID->SetInput(clustersTree, fTSM->GetTrackSegments()) ; |
134 | fPID->SetESD(esd) ; | |
dfe0be07 | 135 | if ( Debug() ) |
dcab1c7e | 136 | fPID->TrackSegments2RecParticles("deb all") ; |
dfe0be07 | 137 | else |
dcab1c7e | 138 | fPID->TrackSegments2RecParticles("") ; |
7acf6008 | 139 | |
dcab1c7e | 140 | TClonesArray *recParticles = fPID->GetRecParticles(); |
141 | Int_t nOfRecParticles = recParticles->GetEntriesFast(); | |
a5fa6165 | 142 | |
85c60a8e | 143 | esd->SetNumberOfPHOSClusters(nOfRecParticles) ; |
dd7ee508 | 144 | esd->SetFirstPHOSCluster(esd->GetNumberOfCaloClusters()) ; |
a5e00016 | 145 | |
9a2cdbdf | 146 | AliDebug(2,Form("%d rec. particles, option %s",nOfRecParticles,GetOption())); |
a5e00016 | 147 | |
148 | // Read digits array | |
149 | ||
150 | TBranch *branch = digitsTree->GetBranch("PHOS"); | |
151 | if (!branch) { | |
152 | AliError("can't get the branch with the PHOS digits !"); | |
153 | return; | |
154 | } | |
6483babc | 155 | branch->SetAddress(&fgDigitsArray); |
a5e00016 | 156 | branch->GetEntry(0); |
157 | ||
158 | // Get the clusters array | |
159 | ||
160 | TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP"); | |
161 | if (!emcbranch) { | |
162 | AliError("can't get the branch with the PHOS EMC clusters !"); | |
163 | return; | |
164 | } | |
165 | ||
6483babc | 166 | emcbranch->SetAddress(&fgEMCRecPoints); |
a5e00016 | 167 | emcbranch->GetEntry(0); |
8013c27e | 168 | |
64df000d | 169 | //#########Calculate trigger and set trigger info########### |
a5e00016 | 170 | |
64df000d | 171 | AliPHOSTrigger tr ; |
172 | // tr.SetPatchSize(1);//create 4x4 patches | |
bfae5a5d | 173 | tr.SetSimulation(kFALSE); |
6483babc | 174 | tr.Trigger(fgDigitsArray); |
64df000d | 175 | |
176 | Float_t maxAmp2x2 = tr.Get2x2MaxAmplitude(); | |
177 | Float_t maxAmpnxn = tr.GetnxnMaxAmplitude(); | |
178 | Float_t ampOutOfPatch2x2 = tr.Get2x2AmpOutOfPatch() ; | |
179 | Float_t ampOutOfPatchnxn = tr.GetnxnAmpOutOfPatch() ; | |
180 | ||
64df000d | 181 | Int_t iSM2x2 = tr.Get2x2SuperModule(); |
182 | Int_t iSMnxn = tr.GetnxnSuperModule(); | |
183 | Int_t iCrystalPhi2x2 = tr.Get2x2CrystalPhi(); | |
184 | Int_t iCrystalPhinxn = tr.GetnxnCrystalPhi(); | |
185 | Int_t iCrystalEta2x2 = tr.Get2x2CrystalEta(); | |
186 | Int_t iCrystalEtanxn = tr.GetnxnCrystalEta(); | |
187 | ||
a5e00016 | 188 | AliDebug(2, Form("Trigger 2x2 max amp %f, out amp %f, SM %d, iphi %d ieta %d", |
189 | maxAmp2x2, ampOutOfPatch2x2, iSM2x2,iCrystalPhi2x2, iCrystalEta2x2)); | |
190 | AliDebug(2, Form("Trigger 4x4 max amp %f , out amp %f, SM %d, iphi %d, ieta %d", | |
191 | maxAmpnxn, ampOutOfPatchnxn, iSMnxn,iCrystalPhinxn, iCrystalEtanxn)); | |
64df000d | 192 | |
bfae5a5d | 193 | // Attention! PHOS modules in order to calculate AbsId need to be 1-5 not 0-4 as returns trigger. |
194 | Int_t iRelId2x2 []= {iSM2x2+1,0,iCrystalPhi2x2,iCrystalEta2x2}; | |
64df000d | 195 | Int_t iAbsId2x2 =-1; |
bfae5a5d | 196 | Int_t iRelIdnxn []= {iSMnxn+1,0,iCrystalPhinxn,iCrystalEtanxn}; |
64df000d | 197 | Int_t iAbsIdnxn =-1; |
198 | TVector3 pos2x2(-1,-1,-1); | |
199 | TVector3 posnxn(-1,-1,-1); | |
9a2cdbdf | 200 | fGeom->RelToAbsNumbering(iRelId2x2, iAbsId2x2); |
201 | fGeom->RelToAbsNumbering(iRelIdnxn, iAbsIdnxn); | |
202 | fGeom->RelPosInAlice(iAbsId2x2, pos2x2); | |
203 | fGeom->RelPosInAlice(iAbsIdnxn, posnxn); | |
64df000d | 204 | |
205 | TArrayF triggerPosition(6); | |
206 | triggerPosition[0] = pos2x2(0) ; | |
207 | triggerPosition[1] = pos2x2(1) ; | |
208 | triggerPosition[2] = pos2x2(2) ; | |
209 | triggerPosition[3] = posnxn(0) ; | |
210 | triggerPosition[4] = posnxn(1) ; | |
211 | triggerPosition[5] = posnxn(2) ; | |
212 | ||
213 | TArrayF triggerAmplitudes(4); | |
214 | triggerAmplitudes[0] = maxAmp2x2 ; | |
215 | triggerAmplitudes[1] = ampOutOfPatch2x2 ; | |
216 | triggerAmplitudes[2] = maxAmpnxn ; | |
217 | triggerAmplitudes[3] = ampOutOfPatchnxn ; | |
218 | ||
219 | //esd->SetPHOSTriggerCells(triggerPosition); | |
220 | esd->AddPHOSTriggerPosition(triggerPosition); | |
221 | esd->AddPHOSTriggerAmplitudes(triggerAmplitudes); | |
222 | ||
e68222ce | 223 | |
a5e00016 | 224 | //######################################## |
225 | //############# Fill CaloCells ########### | |
226 | //######################################## | |
227 | ||
6483babc | 228 | Int_t nDigits = fgDigitsArray->GetEntries(); |
a5e00016 | 229 | Int_t idignew = 0 ; |
230 | AliDebug(1,Form("%d digits",nDigits)); | |
231 | ||
232 | const Int_t knEMC = fGeom->GetNModules()*fGeom->GetNPhi()*fGeom->GetNZ(); | |
233 | AliESDCaloCells &phsCells = *(esd->GetPHOSCells()); | |
234 | phsCells.CreateContainer(nDigits); | |
235 | phsCells.SetType(AliESDCaloCells::kPHOSCell); | |
236 | ||
237 | // Add to CaloCells only EMC digits with non-zero energy | |
238 | for (Int_t idig = 0 ; idig < nDigits ; idig++) { | |
6483babc | 239 | const AliPHOSDigit * dig = (const AliPHOSDigit*)fgDigitsArray->At(idig); |
12dd7f10 | 240 | if(dig->GetId() <= knEMC && |
241 | Calibrate(dig->GetEnergy(),dig->GetId()) > GetRecoParam()->GetEMCMinE() ){ | |
6f47f50d | 242 | phsCells.SetCell(idignew,dig->GetId(), Calibrate(dig->GetEnergy(),dig->GetId()), |
243 | CalibrateT(dig->GetTime(),dig->GetId())); | |
a5e00016 | 244 | idignew++; |
245 | } | |
e68222ce | 246 | } |
a5e00016 | 247 | phsCells.SetNumberOfCells(idignew); |
248 | phsCells.Sort(); | |
e68222ce | 249 | |
a5e00016 | 250 | //######################################## |
251 | //############## Fill CaloClusters ####### | |
252 | //######################################## | |
f4e0dd30 | 253 | |
dfe0be07 | 254 | for (Int_t recpart = 0 ; recpart < nOfRecParticles ; recpart++) { |
a5e00016 | 255 | AliPHOSRecParticle *rp = dynamic_cast<AliPHOSRecParticle*>(recParticles->At(recpart)); |
dfe0be07 | 256 | if (Debug()) |
257 | rp->Print(); | |
25ed816e | 258 | // Get track segment and EMC rec.point associated with this rec.particle |
dcab1c7e | 259 | AliPHOSTrackSegment *ts = static_cast<AliPHOSTrackSegment *>(fTSM->GetTrackSegments() |
a5e00016 | 260 | ->At(rp->GetPHOSTSIndex())); |
9a2cdbdf | 261 | |
6483babc | 262 | AliPHOSEmcRecPoint *emcRP = static_cast<AliPHOSEmcRecPoint *>(fgEMCRecPoints->At(ts->GetEmcIndex())); |
25ed816e | 263 | AliESDCaloCluster *ec = new AliESDCaloCluster() ; |
e68222ce | 264 | |
85c60a8e | 265 | Float_t xyz[3]; |
8013c27e | 266 | for (Int_t ixyz=0; ixyz<3; ixyz++) |
267 | xyz[ixyz] = rp->GetPos()[ixyz]; | |
dd7ee508 | 268 | |
269 | AliDebug(2,Form("Global position xyz=(%f,%f,%f)",xyz[0],xyz[1],xyz[2])); | |
77ea1c6f | 270 | |
a5e00016 | 271 | // Create cell lists |
272 | ||
273 | Int_t cellMult = emcRP->GetDigitsMultiplicity(); | |
274 | Int_t *digitsList = emcRP->GetDigitsList(); | |
275 | Float_t *rpElist = emcRP->GetEnergiesList() ; | |
276 | UShort_t *absIdList = new UShort_t[cellMult]; | |
277 | Double_t *fracList = new Double_t[cellMult]; | |
278 | ||
279 | for (Int_t iCell=0; iCell<cellMult; iCell++) { | |
6483babc | 280 | AliPHOSDigit *digit = static_cast<AliPHOSDigit *>(fgDigitsArray->At(digitsList[iCell])); |
a5e00016 | 281 | absIdList[iCell] = (UShort_t)(digit->GetId()); |
282 | if (digit->GetEnergy() > 0) | |
d3aa2291 | 283 | fracList[iCell] = rpElist[iCell]/(Calibrate(digit->GetEnergy(),digit->GetId())); |
a5e00016 | 284 | else |
285 | fracList[iCell] = 0; | |
25ed816e | 286 | } |
77ea1c6f | 287 | |
7592dfc4 | 288 | //Primaries |
289 | Int_t primMult = 0; | |
4dd59c4a | 290 | Int_t *primList = emcRP->GetPrimaries(primMult); |
a5e00016 | 291 | |
48c5db5b | 292 | Float_t energy; |
7e88424f | 293 | if (GetRecoParam()->EMCEcore2ESD()) |
48c5db5b | 294 | energy = emcRP->GetCoreEnergy(); |
295 | else | |
296 | energy = rp->Energy(); | |
297 | ||
7592dfc4 | 298 | // fills the ESDCaloCluster |
8ada0ffe | 299 | ec->SetClusterType(AliESDCaloCluster::kPHOSCluster); |
a5e00016 | 300 | ec->SetPosition(xyz); //rec.point position in MARS |
48c5db5b | 301 | ec->SetE(energy); //total or core particle energy |
25ed816e | 302 | ec->SetClusterDisp(emcRP->GetDispersion()); //cluster dispersion |
e68222ce | 303 | ec->SetPid(rp->GetPID()) ; //array of particle identification |
25ed816e | 304 | ec->SetM02(emcRP->GetM2x()) ; //second moment M2x |
305 | ec->SetM20(emcRP->GetM2z()) ; //second moment M2z | |
306 | ec->SetNExMax(emcRP->GetNExMax()); //number of local maxima | |
a5e00016 | 307 | ec->SetEmcCpvDistance(ts->GetCpvDistance("r")); //Only radius, what about separate x,z???? |
25ed816e | 308 | ec->SetClusterChi2(-1); //not yet implemented |
6f47f50d | 309 | ec->SetTOF(emcRP->GetTime()); //Time of flight - already calibrated in EMCRecPoint |
78902954 | 310 | |
a5e00016 | 311 | //Cells contributing to clusters |
312 | ec->SetNCells(cellMult); | |
313 | ec->SetCellsAbsId(absIdList); | |
314 | ec->SetCellsAmplitudeFraction(fracList); | |
7592dfc4 | 315 | |
3744a6cf | 316 | //Distance to the nearest bad crystal |
317 | ec->SetDistanceToBadChannel(emcRP->GetDistanceToBadCrystal()); | |
7592dfc4 | 318 | |
319 | //Array of MC indeces | |
4dd59c4a | 320 | TArrayI arrayPrim(primMult,primList); |
7592dfc4 | 321 | ec->AddLabels(arrayPrim); |
64df000d | 322 | |
e44c41e9 | 323 | //Matched ESD track |
324 | TArrayI arrayTrackMatched(1); | |
325 | arrayTrackMatched[0]= ts->GetTrackIndex(); | |
326 | ec->AddTracksMatched(arrayTrackMatched); | |
327 | ||
85c60a8e | 328 | esd->AddCaloCluster(ec); |
9a2cdbdf | 329 | delete ec; |
091d150a | 330 | delete [] fracList; |
331 | delete [] absIdList; | |
e68222ce | 332 | } |
6483babc | 333 | fgDigitsArray ->Delete(); |
334 | fgEMCRecPoints->Delete(); | |
335 | recParticles ->Delete(); | |
bb5c37a5 | 336 | |
337 | //Store PHOS misalignment matrixes | |
338 | FillMisalMatrixes(esd) ; | |
339 | ||
dd7ee508 | 340 | } |
341 | ||
e68222ce | 342 | //____________________________________________________________________________ |
d76c31f4 | 343 | AliTracker* AliPHOSReconstructor::CreateTracker() const |
dd7ee508 | 344 | { |
9a2cdbdf | 345 | // creates the PHOS tracker |
346 | return new AliPHOSTracker(); | |
347 | } | |
dd7ee508 | 348 | |
1267d56d | 349 | //____________________________________________________________________________ |
9a2cdbdf | 350 | void AliPHOSReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const |
351 | { | |
352 | // Converts raw data to | |
353 | // PHOS digits | |
354 | // Works on a single-event basis | |
9a2cdbdf | 355 | rawReader->Reset() ; |
dd7ee508 | 356 | |
379c5c09 | 357 | AliPHOSRawFitterv0 * fitter ; |
77ea1c6f | 358 | |
7e88424f | 359 | const TObjArray* maps = AliPHOSRecoParam::GetMappings(); |
b3006690 | 360 | if(!maps) AliFatal("Cannot retrieve ALTRO mappings!!"); |
361 | ||
47ba0d5d | 362 | AliAltroMapping *mapping[20]; |
363 | for(Int_t i = 0; i < 20; i++) { | |
b3006690 | 364 | mapping[i] = (AliAltroMapping*)maps->At(i); |
365 | } | |
366 | ||
379c5c09 | 367 | if (strcmp(GetRecoParam()->EMCFitterVersion(),"v1")==0) |
368 | fitter=new AliPHOSRawFitterv1(); | |
369 | else if (strcmp(GetRecoParam()->EMCFitterVersion(),"v2")==0) | |
370 | fitter=new AliPHOSRawFitterv2(); | |
f4a5c5fd | 371 | else if (strcmp(GetRecoParam()->EMCFitterVersion(),"v3")==0) |
372 | fitter=new AliPHOSRawFitterv3(); | |
7e88424f | 373 | else |
379c5c09 | 374 | fitter=new AliPHOSRawFitterv0(); |
77ea1c6f | 375 | |
379c5c09 | 376 | fitter->SubtractPedestals(GetRecoParam()->EMCSubtractPedestals()); |
377 | fitter->SetAmpOffset (GetRecoParam()->GetGlobalAltroOffset()); | |
378 | fitter->SetAmpThreshold (GetRecoParam()->GetGlobalAltroThreshold()); | |
8be3a30a | 379 | |
9a2cdbdf | 380 | TClonesArray *digits = new TClonesArray("AliPHOSDigit",1); |
381 | digits->SetName("DIGITS"); | |
382 | Int_t bufsize = 32000; | |
383 | digitsTree->Branch("PHOS", &digits, bufsize); | |
dd7ee508 | 384 | |
379c5c09 | 385 | AliPHOSRawDigiProducer rdp(rawReader,mapping); |
8be3a30a | 386 | |
379c5c09 | 387 | rdp.SetEmcMinAmp(GetRecoParam()->GetEMCRawDigitThreshold()); // in ADC |
388 | rdp.SetCpvMinAmp(GetRecoParam()->GetCPVMinE()); | |
389 | rdp.SetSampleQualityCut(GetRecoParam()->GetEMCSampleQualityCut()); | |
390 | rdp.MakeDigits(digits,fitter); | |
77ea1c6f | 391 | |
379c5c09 | 392 | delete fitter ; |
7592dfc4 | 393 | |
379c5c09 | 394 | if (AliLog::GetGlobalDebugLevel() == 1) { |
395 | Int_t modMax=-111; | |
396 | Int_t colMax=-111; | |
397 | Int_t rowMax=-111; | |
398 | Float_t eMax=-333; | |
399 | //!!!for debug!!! | |
400 | ||
401 | Int_t relId[4]; | |
402 | for(Int_t iDigit=0; iDigit<digits->GetEntries(); iDigit++) { | |
403 | AliPHOSDigit* digit = (AliPHOSDigit*)digits->At(iDigit); | |
404 | if(digit->GetEnergy()>eMax) { | |
405 | fGeom->AbsToRelNumbering(digit->GetId(),relId); | |
406 | eMax=digit->GetEnergy(); | |
407 | modMax=relId[0]; | |
408 | rowMax=relId[2]; | |
409 | colMax=relId[3]; | |
410 | } | |
dd7ee508 | 411 | } |
379c5c09 | 412 | |
413 | AliDebug(1,Form("Digit with max. energy: modMax %d colMax %d rowMax %d eMax %f\n\n", | |
414 | modMax,colMax,rowMax,eMax)); | |
dd7ee508 | 415 | } |
416 | ||
9a2cdbdf | 417 | digitsTree->Fill(); |
e68222ce | 418 | digits->Delete(); |
419 | delete digits; | |
d7d3b67b | 420 | } |
d3aa2291 | 421 | //================================================================================== |
422 | Float_t AliPHOSReconstructor::Calibrate(Float_t amp, Int_t absId)const{ | |
423 | // Calibrate EMC digit, i.e. multiply its Amp by a factor read from CDB | |
424 | ||
425 | const AliPHOSGeometry *geom = AliPHOSGeometry::GetInstance() ; | |
426 | ||
427 | //Determine rel.position of the cell absolute ID | |
428 | Int_t relId[4]; | |
429 | geom->AbsToRelNumbering(absId,relId); | |
430 | Int_t module=relId[0]; | |
431 | Int_t row =relId[2]; | |
432 | Int_t column=relId[3]; | |
433 | if(relId[1]){ //CPV | |
434 | Float_t calibration = fgCalibData->GetADCchannelCpv(module,column,row); | |
435 | return amp*calibration ; | |
436 | } | |
437 | else{ //EMC | |
438 | Float_t calibration = fgCalibData->GetADCchannelEmc(module,column,row); | |
439 | return amp*calibration ; | |
440 | } | |
441 | } | |
bb5c37a5 | 442 | //================================================================================== |
6f47f50d | 443 | Float_t AliPHOSReconstructor::CalibrateT(Float_t time, Int_t absId)const{ |
444 | // Calibrate EMC digit, i.e. multiply its Amp by a factor read from CDB | |
445 | ||
446 | const AliPHOSGeometry *geom = AliPHOSGeometry::GetInstance() ; | |
447 | ||
448 | //Determine rel.position of the cell absolute ID | |
449 | Int_t relId[4]; | |
450 | geom->AbsToRelNumbering(absId,relId); | |
451 | Int_t module=relId[0]; | |
452 | Int_t row =relId[2]; | |
453 | Int_t column=relId[3]; | |
454 | if(relId[1]){ //CPV | |
455 | return 0. ; | |
456 | } | |
457 | else{ //EMC | |
458 | time += fgCalibData->GetTimeShiftEmc(module,column,row); | |
459 | return time ; | |
460 | } | |
461 | } | |
462 | //================================================================================== | |
bb5c37a5 | 463 | void AliPHOSReconstructor::FillMisalMatrixes(AliESDEvent* esd)const{ |
464 | //Store PHOS matrixes in ESD Header | |
465 | ||
466 | //Check, if matrixes was already stored | |
467 | for(Int_t mod=0 ;mod<5; mod++){ | |
468 | if(esd->GetPHOSMatrix(mod)!=0) | |
469 | return ; | |
470 | } | |
471 | ||
472 | //Create and store matrixes | |
473 | if(!gGeoManager){ | |
474 | AliError("Can not store misal. matrixes: no gGeoManager! \n") ; | |
475 | return ; | |
476 | } | |
477 | //Note, that owner of copied marixes will be header | |
478 | char path[255] ; | |
479 | TGeoHMatrix * m ; | |
480 | for(Int_t mod=0; mod<5; mod++){ | |
481 | sprintf(path,"/ALIC_1/PHOS_%d",mod+1) ; //In Geometry modules numbered 1,2,.,5 | |
482 | if (gGeoManager->cd(path)){ | |
483 | m = gGeoManager->GetCurrentMatrix() ; | |
484 | esd->SetPHOSMatrix(new TGeoHMatrix(*m),mod) ; | |
485 | } | |
486 | else{ | |
487 | esd->SetPHOSMatrix(NULL,mod) ; | |
488 | } | |
489 | } | |
490 | ||
491 | } | |
d3aa2291 | 492 | |
493 |