]>
Commit | Line | Data |
---|---|---|
4c039060 | 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 | **************************************************************************/ | |
4c039060 | 15 | |
88cb7938 | 16 | /* $Id$ */ |
17 | ||
3d1463c8 | 18 | //----------------------------------------------------------------------------- |
d19b6003 | 19 | // Class AliMUON |
20 | // ------------------ | |
21 | // AliDetector class for MUON subsystem | |
22 | // providing simulation data management | |
3d1463c8 | 23 | //----------------------------------------------------------------------------- |
fe4da5cc | 24 | |
4069c48e | 25 | #include "AliMUON.h" |
88cb7938 | 26 | |
4069c48e | 27 | #include "AliMUONSDigitizerV2.h" |
28 | #include "AliMUONDigitizerV3.h" | |
29 | #include "AliMUONDigitMaker.h" | |
5d950f54 | 30 | #include "AliMUONDigit.h" |
4069c48e | 31 | #include "AliMUONCalibrationData.h" |
32 | ||
33 | #include "AliMUONDigitStoreV1.h" | |
34 | #include "AliMUONVTriggerStore.h" | |
35 | #include "AliMUONHitStoreV1.h" | |
fe4da5cc | 36 | |
88cb7938 | 37 | #include "AliMUONChamberTrigger.h" |
88cb7938 | 38 | #include "AliMUONConstants.h" |
504d0837 | 39 | #include "AliMUONGeometry.h" |
40 | #include "AliMUONGeometryTransformer.h" | |
d4bb94a1 | 41 | #include "AliMUONGeometryBuilder.h" |
d1cd2474 | 42 | #include "AliMUONVGeometryBuilder.h" |
4069c48e | 43 | #include "AliMUONCommonGeometryBuilder.h" |
d5609cfc | 44 | #include "AliMUONSt1GeometryBuilderV2.h" |
45 | #include "AliMUONSt2GeometryBuilderV2.h" | |
46 | #include "AliMUONSlatGeometryBuilder.h" | |
47 | #include "AliMUONTriggerGeometryBuilder.h" | |
5d950f54 | 48 | #include "AliMUONDigitCalibrator.h" |
49 | #include "AliMUONRecoParam.h" | |
50 | #include "AliCDBManager.h" | |
51 | #include "AliCDBEntry.h" | |
d5609cfc | 52 | |
4069c48e | 53 | #include "AliMUONRawWriter.h" |
54 | ||
55 | #include "AliLoader.h" | |
56 | #include "AliCDBManager.h" | |
57 | #include "AliRunDigitizer.h" | |
58 | #include "AliMC.h" | |
59 | #include "AliRun.h" | |
60 | #include "AliRawDataHeaderSim.h" | |
61 | #include "AliLog.h" | |
62 | ||
63 | #include <TObjArray.h> | |
7435e1f8 | 64 | |
a9e2aefa | 65 | // Defaults parameters for Z positions of chambers |
66 | // taken from values for "stations" in AliMUON::AliMUON | |
67 | // const Float_t zch[7]={528, 690., 975., 1249., 1449., 1610, 1710.}; | |
68 | // and from array "dstation" in AliMUONv1::CreateGeometry | |
69 | // Float_t dstation[5]={20., 20., 20, 20., 20.}; | |
70 | // for tracking chambers, | |
71 | // according to (Z1 = zch - dstation) and (Z2 = zch + dstation) | |
72 | // for the first and second chambers in the station, respectively, | |
73 | // and from "DTPLANES" in AliMUONv1::CreateGeometry | |
74 | // const Float_t DTPLANES = 15.; | |
75 | // for trigger chambers, | |
76 | // according to (Z1 = zch) and (Z2 = zch + DTPLANES) | |
77 | // for the first and second chambers in the station, respectively | |
fe4da5cc | 78 | |
13985652 | 79 | /// \cond CLASSIMP |
80 | ClassImp(AliMUON) | |
81 | /// \endcond | |
30178c30 | 82 | |
ce3f5e87 | 83 | //__________________________________________________________________ |
fe4da5cc | 84 | AliMUON::AliMUON() |
30178c30 | 85 | : AliDetector(), |
86 | fNCh(0), | |
87 | fNTrackingCh(0), | |
30178c30 | 88 | fSplitLevel(0), |
89 | fChambers(0), | |
d4bb94a1 | 90 | fGeometryBuilder(0), |
30178c30 | 91 | fAccCut(kFALSE), |
92 | fAccMin(0.), | |
93 | fAccMax(0.), | |
94 | fMaxStepGas(0.), | |
95 | fMaxStepAlu(0.), | |
96 | fMaxDestepGas(0.), | |
97 | fMaxDestepAlu(0.), | |
98 | fMaxIterPad(0), | |
ced309a5 | 99 | fCurIterPad(0), |
d631bec8 | 100 | fIsMaxStep(kTRUE), |
68585390 | 101 | fTriggerScalerEvent(kFALSE), |
e93b11d0 | 102 | fTriggerResponseV1(kFALSE), |
103 | fTriggerCoinc44(0), | |
afb3ccf0 | 104 | fTriggerEffCells(0), |
8c0b5e70 | 105 | fDigitizerWithNoise(1), |
5c083cba | 106 | fDigitizerNSigmas(4.0), |
5fe36481 | 107 | fIsTailEffect(kTRUE), |
241560c2 | 108 | fRawWriter(0x0), |
7435e1f8 | 109 | fDigitMaker(0x0), |
5ee595ac | 110 | fHitStore(0x0), |
92c23b09 | 111 | fDigitStoreConcreteClassName(), |
5d950f54 | 112 | fCalibrationData(0x0), |
113 | fDigitCalibrator(0x0) | |
fe4da5cc | 114 | { |
d19b6003 | 115 | /// Default Constructor |
116 | ||
117 | AliDebug(1,Form("default (empty) ctor this=%p",this)); | |
1bd26093 | 118 | fIshunt = 0; |
fe4da5cc | 119 | } |
30178c30 | 120 | |
ce3f5e87 | 121 | //__________________________________________________________________ |
9bf406e1 | 122 | AliMUON::AliMUON(const char *name, const char* title) |
123 | : AliDetector(name, title), | |
30178c30 | 124 | fNCh(AliMUONConstants::NCh()), |
125 | fNTrackingCh(AliMUONConstants::NTrackingCh()), | |
30178c30 | 126 | fSplitLevel(0), |
127 | fChambers(0), | |
d4bb94a1 | 128 | fGeometryBuilder(0), |
30178c30 | 129 | fAccCut(kFALSE), |
130 | fAccMin(0.), | |
131 | fAccMax(0.), | |
132 | fMaxStepGas(0.1), | |
133 | fMaxStepAlu(0.1), | |
134 | fMaxDestepGas(-1), // Negatives values are ignored by geant3 CONS200 | |
135 | fMaxDestepAlu(-1), // in the calculation of the tracking parameters | |
136 | fMaxIterPad(0), | |
ced309a5 | 137 | fCurIterPad(0), |
d631bec8 | 138 | fIsMaxStep(kTRUE), |
e93b11d0 | 139 | fTriggerScalerEvent(kFALSE), |
140 | fTriggerResponseV1(kFALSE), | |
141 | fTriggerCoinc44(0), | |
afb3ccf0 | 142 | fTriggerEffCells(0), |
8c0b5e70 | 143 | fDigitizerWithNoise(1), |
5c083cba | 144 | fDigitizerNSigmas(4.0), |
5fe36481 | 145 | fIsTailEffect(kTRUE), |
241560c2 | 146 | fRawWriter(0x0), |
7435e1f8 | 147 | fDigitMaker(new AliMUONDigitMaker), |
5ee595ac | 148 | fHitStore(0x0), |
92c23b09 | 149 | fDigitStoreConcreteClassName("AliMUONDigitStoreV2S"), |
5d950f54 | 150 | fCalibrationData(), |
151 | fDigitCalibrator(0x0) | |
fe4da5cc | 152 | { |
92c23b09 | 153 | /// Standard constructor |
d19b6003 | 154 | |
155 | AliDebug(1,Form("ctor this=%p",this)); | |
30178c30 | 156 | fIshunt = 0; |
92c23b09 | 157 | |
e939a978 | 158 | //PH SetMarkerColor(kRed);// |
e118b27e | 159 | |
160 | // Geometry builder | |
161 | fGeometryBuilder = new AliMUONGeometryBuilder(this); | |
162 | ||
163 | // Common geometry definitions | |
164 | fGeometryBuilder | |
165 | ->AddBuilder(new AliMUONCommonGeometryBuilder(this)); | |
92c23b09 | 166 | |
d5609cfc | 167 | // By default, add also all the needed geometry builders. |
168 | // If you want to change this from outside, please use ResetGeometryBuilder | |
169 | // method, followed by AddGeometryBuilder ones. | |
92c23b09 | 170 | |
d5609cfc | 171 | AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(this)); |
172 | AddGeometryBuilder(new AliMUONSt2GeometryBuilderV2(this)); | |
173 | AddGeometryBuilder(new AliMUONSlatGeometryBuilder(this)); | |
174 | AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(this)); | |
175 | ||
176 | // | |
177 | // Creating List of Chambers | |
a9e2aefa | 178 | Int_t ch; |
f665c1ea | 179 | fChambers = new TObjArray(AliMUONConstants::NCh()); |
7435e1f8 | 180 | fChambers->SetOwner(kTRUE); |
181 | ||
a9e2aefa | 182 | // Loop over stations |
f665c1ea | 183 | for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) { |
a9e2aefa | 184 | // Loop over 2 chambers in the station |
ce3f5e87 | 185 | for (Int_t stCH = 0; stCH < 2; stCH++) { |
186 | // | |
187 | // | |
188 | // Default Parameters for Muon Tracking Stations | |
189 | ch = 2 * st + stCH; | |
190 | if (ch < AliMUONConstants::NTrackingCh()) { | |
191 | fChambers->AddAt(new AliMUONChamber(ch),ch); | |
192 | } else { | |
504d0837 | 193 | fChambers->AddAt(new AliMUONChamberTrigger(ch, GetGeometryTransformer()),ch); |
ce3f5e87 | 194 | } |
ce3f5e87 | 195 | } // Chamber stCH (0, 1) in |
a9e2aefa | 196 | } // Station st (0...) |
92c23b09 | 197 | |
198 | Int_t runnumber = AliCDBManager::Instance()->GetRun(); | |
199 | ||
200 | fCalibrationData = new AliMUONCalibrationData(runnumber); | |
fe4da5cc | 201 | } |
30178c30 | 202 | |
ce3f5e87 | 203 | //____________________________________________________________________ |
fe4da5cc | 204 | AliMUON::~AliMUON() |
205 | { | |
d19b6003 | 206 | /// Destructor |
207 | ||
edee5e63 | 208 | AliDebug(1,Form("dtor this=%p",this)); |
7435e1f8 | 209 | delete fChambers; |
d4bb94a1 | 210 | delete fGeometryBuilder; |
d5609cfc | 211 | delete fRawWriter; |
241560c2 | 212 | delete fDigitMaker; |
7435e1f8 | 213 | delete fHitStore; |
92c23b09 | 214 | delete fCalibrationData; |
5d950f54 | 215 | delete fDigitCalibrator; |
d1cd2474 | 216 | } |
30178c30 | 217 | |
d1cd2474 | 218 | //_____________________________________________________________________________ |
219 | void AliMUON::AddGeometryBuilder(AliMUONVGeometryBuilder* geomBuilder) | |
220 | { | |
d19b6003 | 221 | /// Add the geometry builder to the list |
d1cd2474 | 222 | |
d4bb94a1 | 223 | fGeometryBuilder->AddBuilder(geomBuilder); |
a897a37a | 224 | } |
c9d10ab5 | 225 | |
504d0837 | 226 | //____________________________________________________________________ |
227 | const AliMUONGeometry* AliMUON::GetGeometry() const | |
228 | { | |
d19b6003 | 229 | /// Return geometry parametrisation |
504d0837 | 230 | |
231 | if ( !fGeometryBuilder) { | |
232 | AliWarningStream() << "GeometryBuilder not defined." << std::endl; | |
233 | return 0; | |
234 | } | |
235 | ||
236 | return fGeometryBuilder->GetGeometry(); | |
237 | } | |
238 | ||
239 | //____________________________________________________________________ | |
240 | const AliMUONGeometryTransformer* AliMUON::GetGeometryTransformer() const | |
241 | { | |
d19b6003 | 242 | /// Return geometry parametrisation |
504d0837 | 243 | |
244 | const AliMUONGeometry* kGeometry = GetGeometry(); | |
245 | ||
246 | if ( !kGeometry) return 0; | |
247 | ||
248 | return kGeometry->GetTransformer(); | |
249 | } | |
250 | ||
ce3f5e87 | 251 | //__________________________________________________________________ |
7435e1f8 | 252 | void |
253 | AliMUON::MakeBranch(Option_t* opt) | |
a897a37a | 254 | { |
7435e1f8 | 255 | /// Create branche(s) to hold MUON hits |
256 | AliDebug(1,""); | |
257 | ||
258 | TString sopt(opt); | |
259 | if ( sopt != "H" ) return; | |
260 | ||
261 | if (!fHitStore) | |
262 | { | |
263 | fHitStore = new AliMUONHitStoreV1; | |
ae31c826 | 264 | if ( gAlice->GetMCApp() ) |
7435e1f8 | 265 | { |
266 | if ( gAlice->GetMCApp()->GetHitLists() ) | |
267 | { | |
268 | // AliStack::PurifyKine needs to be able to loop on our hits | |
269 | // to remap the track numbers. | |
270 | gAlice->GetMCApp()->AddHitList(fHitStore->Collection()); | |
6d2f7cbd | 271 | } |
7435e1f8 | 272 | } |
273 | } | |
274 | ||
275 | TTree* treeH = fLoader->TreeH(); | |
276 | ||
277 | if (!treeH) | |
278 | { | |
279 | AliFatal("No TreeH"); | |
307d9d04 | 280 | } |
7435e1f8 | 281 | |
282 | fHitStore->Connect(*treeH); | |
283 | } | |
284 | ||
285 | //__________________________________________________________________ | |
286 | void | |
287 | AliMUON::SetTreeAddress() | |
288 | { | |
289 | /// Set Hits tree address | |
290 | ||
291 | // if ( gAlice->GetMCApp() && fHitStore ) | |
292 | // { | |
293 | // TList* l = gAlice->GetMCApp()->GetHitLists(); | |
294 | // if ( l ) | |
295 | // { | |
296 | // TObject* o = l->First(); | |
297 | // if (o!=fHitStore->HitCollection()) | |
298 | // { | |
299 | // AliError(Form("Something is strange hitcollection=%x",fHitStore->HitCollection())); | |
300 | // l->Print(); | |
301 | // } | |
302 | // } | |
303 | // } | |
304 | } | |
305 | ||
306 | //_________________________________________________________________ | |
307 | void | |
308 | AliMUON::ResetHits() | |
309 | { | |
310 | /// Reset hits | |
311 | ||
312 | AliDebug(1,""); | |
313 | if (fHitStore) fHitStore->Clear(); | |
a9e2aefa | 314 | } |
315 | ||
ce3f5e87 | 316 | //_________________________________________________________________ |
a897a37a | 317 | void AliMUON::SetChargeSlope(Int_t id, Float_t p1) |
fe4da5cc | 318 | { |
d19b6003 | 319 | /// Set the inverse charge slope for chamber id |
320 | ||
ce3f5e87 | 321 | Int_t i=2*(id-1); //PH ((AliMUONChamber*) (*fChambers)[i])->SetSigmaIntegration(p1); |
322 | //PH ((AliMUONChamber*) (*fChambers)[i+1])->SetSigmaIntegration(p1); | |
2682e810 | 323 | ((AliMUONChamber*) fChambers->At(i))->SetChargeSlope(p1); |
324 | ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSlope(p1); | |
fe4da5cc | 325 | } |
ce3f5e87 | 326 | //__________________________________________________________________ |
a897a37a | 327 | void AliMUON::SetChargeSpread(Int_t id, Float_t p1, Float_t p2) |
fe4da5cc | 328 | { |
d19b6003 | 329 | /// Set sigma of charge spread for chamber id |
330 | ||
fe4da5cc | 331 | Int_t i=2*(id-1); |
2682e810 | 332 | ((AliMUONChamber*) fChambers->At(i))->SetChargeSpread(p1,p2); |
333 | ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSpread(p1,p2); | |
fe4da5cc | 334 | } |
ce3f5e87 | 335 | //___________________________________________________________________ |
a897a37a | 336 | void AliMUON::SetSigmaIntegration(Int_t id, Float_t p1) |
fe4da5cc | 337 | { |
d19b6003 | 338 | /// Set integration limits for charge spread |
fe4da5cc | 339 | Int_t i=2*(id-1); |
2682e810 | 340 | ((AliMUONChamber*) fChambers->At(i))->SetSigmaIntegration(p1); |
341 | ((AliMUONChamber*) fChambers->At(i+1))->SetSigmaIntegration(p1); | |
fe4da5cc | 342 | } |
343 | ||
ce3f5e87 | 344 | //__________________________________________________________________ |
d09fafb0 | 345 | void AliMUON::SetMaxAdc(Int_t id, Int_t p1) |
fe4da5cc | 346 | { |
d19b6003 | 347 | /// Set maximum number for ADCcounts (saturation) |
348 | ||
fe4da5cc | 349 | Int_t i=2*(id-1); |
2682e810 | 350 | ((AliMUONChamber*) fChambers->At(i))->SetMaxAdc(p1); |
351 | ((AliMUONChamber*) fChambers->At(i+1))->SetMaxAdc(p1); | |
fe4da5cc | 352 | } |
d4bb94a1 | 353 | |
ce3f5e87 | 354 | //__________________________________________________________________ |
a897a37a | 355 | void AliMUON::SetMaxStepGas(Float_t p1) |
fe4da5cc | 356 | { |
d19b6003 | 357 | /// Set stepsize in gas |
358 | ||
ce3f5e87 | 359 | fMaxStepGas=p1; |
fe4da5cc | 360 | } |
ce3f5e87 | 361 | //__________________________________________________________________ |
a897a37a | 362 | void AliMUON::SetMaxStepAlu(Float_t p1) |
fe4da5cc | 363 | { |
d19b6003 | 364 | /// Set step size in Alu |
365 | ||
fe4da5cc | 366 | fMaxStepAlu=p1; |
367 | } | |
ce3f5e87 | 368 | //__________________________________________________________________ |
a897a37a | 369 | void AliMUON::SetMaxDestepGas(Float_t p1) |
fe4da5cc | 370 | { |
d19b6003 | 371 | /// Set maximum step size in Gas |
372 | ||
fe4da5cc | 373 | fMaxDestepGas=p1; |
374 | } | |
ce3f5e87 | 375 | //__________________________________________________________________ |
a897a37a | 376 | void AliMUON::SetMaxDestepAlu(Float_t p1) |
fe4da5cc | 377 | { |
d19b6003 | 378 | /// Set maximum step size in Alu |
379 | ||
ce3f5e87 | 380 | fMaxDestepAlu=p1; |
fe4da5cc | 381 | } |
d4bb94a1 | 382 | |
d1cd2474 | 383 | //____________________________________________________________________ |
384 | Float_t AliMUON::GetMaxStepGas() const | |
385 | { | |
d19b6003 | 386 | /// Return stepsize in gas |
d1cd2474 | 387 | |
388 | return fMaxStepGas; | |
389 | } | |
390 | ||
391 | //____________________________________________________________________ | |
392 | Float_t AliMUON::GetMaxStepAlu() const | |
393 | { | |
d19b6003 | 394 | /// Return step size in Alu |
d1cd2474 | 395 | |
396 | return fMaxStepAlu; | |
397 | } | |
398 | ||
399 | //____________________________________________________________________ | |
400 | Float_t AliMUON::GetMaxDestepGas() const | |
401 | { | |
d19b6003 | 402 | /// Return maximum step size in Gas |
d1cd2474 | 403 | |
404 | return fMaxDestepGas; | |
405 | } | |
406 | ||
407 | //____________________________________________________________________ | |
408 | Float_t AliMUON::GetMaxDestepAlu() const | |
409 | { | |
d19b6003 | 410 | /// Return maximum step size in Gas |
d1cd2474 | 411 | |
412 | return fMaxDestepAlu; | |
413 | } | |
d4bb94a1 | 414 | |
883746f3 | 415 | //____________________________________________________________________ |
416 | void AliMUON::SetAlign(Bool_t align) | |
a713db22 | 417 | { |
d19b6003 | 418 | /// Set option for alignement to geometry builder |
883746f3 | 419 | |
420 | fGeometryBuilder->SetAlign(align); | |
421 | } | |
fe4da5cc | 422 | |
82d1ac0a | 423 | //____________________________________________________________________ |
424 | void AliMUON::SetAlign(const TString& fileName, Bool_t align) | |
425 | { | |
d19b6003 | 426 | /// Set option for alignement to geometry builder |
82d1ac0a | 427 | |
428 | fGeometryBuilder->SetAlign(fileName, align); | |
429 | } | |
430 | ||
ce3f5e87 | 431 | //____________________________________________________________________ |
7435e1f8 | 432 | void AliMUON::SetResponseModel(Int_t id, const AliMUONResponse& response) |
fe4da5cc | 433 | { |
d19b6003 | 434 | /// Set the response for chamber id |
2682e810 | 435 | ((AliMUONChamber*) fChambers->At(id))->SetResponseModel(response); |
fe4da5cc | 436 | } |
d19b6003 | 437 | |
ce3f5e87 | 438 | //____________________________________________________________________ |
c92eb8ad | 439 | AliDigitizer* AliMUON::CreateDigitizer(AliRunDigitizer* manager) const |
85a5290f | 440 | { |
a3249004 | 441 | /// Return digitizer |
68585390 | 442 | |
92c23b09 | 443 | AliMUONDigitizerV3* digitizer = new AliMUONDigitizerV3(manager, fDigitizerWithNoise); |
5c083cba | 444 | AliMUONDigitizerV3::SetNSigmas(fDigitizerNSigmas); |
b89ac3d6 | 445 | digitizer->SetCalibrationData(fCalibrationData); |
92c23b09 | 446 | return digitizer; |
85a5290f | 447 | } |
68585390 | 448 | |
ce3f5e87 | 449 | //_____________________________________________________________________ |
2ab0c725 | 450 | void AliMUON::SDigits2Digits() |
451 | { | |
d19b6003 | 452 | /// Write TreeD here only |
d963c261 | 453 | |
d963c261 | 454 | char hname[30]; |
88cb7938 | 455 | // sprintf(hname,"TreeD%d",fLoader->GetHeader()->GetEvent()); |
456 | fLoader->TreeD()->Write(hname,TObject::kOverwrite); | |
457 | fLoader->TreeD()->Reset(); | |
2ab0c725 | 458 | } |
a9e2aefa | 459 | |
d1775029 | 460 | //_____________________________________________________________________ |
461 | void AliMUON::Hits2SDigits() | |
462 | { | |
a3249004 | 463 | /// Perform Hits2Digits using SDigitizerV2 |
68585390 | 464 | |
7435e1f8 | 465 | AliMUONSDigitizerV2 sdigitizer; |
466 | sdigitizer.ExecuteTask(); | |
d1775029 | 467 | } |
68585390 | 468 | |
39e39255 | 469 | //_____________________________________________________________________ |
470 | void AliMUON::Digits2Raw() | |
471 | { | |
d19b6003 | 472 | /// Convert digits of the current event to raw data |
473 | ||
0014fbe8 | 474 | AliRawDataHeaderSim header; |
475 | ||
d5609cfc | 476 | if (!fRawWriter) |
477 | { | |
7435e1f8 | 478 | fRawWriter = new AliMUONRawWriter; |
479 | AliDebug(1,Form("Creating %s",fRawWriter->ClassName())); | |
d5609cfc | 480 | if (fTriggerScalerEvent == kTRUE) |
481 | { | |
84ceeb06 | 482 | fRawWriter->SetScalersNumbers(); |
d5609cfc | 483 | } |
484 | } | |
485 | ||
7435e1f8 | 486 | fLoader->LoadDigits("READ"); |
487 | ||
488 | TTree* treeD = fLoader->TreeD(); | |
489 | ||
490 | if (!treeD) | |
491 | { | |
492 | AliError("Could not get TreeD"); | |
493 | return; | |
494 | } | |
495 | ||
496 | AliMUONVTriggerStore* triggerStore = AliMUONVTriggerStore::Create(*treeD); | |
497 | AliMUONVDigitStore* digitStore = AliMUONVDigitStore::Create(*treeD); | |
498 | ||
499 | triggerStore->Connect(*treeD,kFALSE); | |
500 | digitStore->Connect(*treeD,kFALSE); | |
501 | ||
502 | treeD->GetEvent(0); | |
503 | ||
0014fbe8 | 504 | fRawWriter->SetHeader(header); |
7435e1f8 | 505 | if (!fRawWriter->Digits2Raw(digitStore,triggerStore)) |
d5609cfc | 506 | { |
507 | AliError("pb writting raw data"); | |
508 | } | |
7435e1f8 | 509 | |
510 | delete triggerStore; | |
511 | delete digitStore; | |
512 | ||
513 | fLoader->UnloadDigits(); | |
39e39255 | 514 | } |
68585390 | 515 | |
241560c2 | 516 | //_____________________________________________________________________ |
517 | Bool_t AliMUON::Raw2SDigits(AliRawReader* rawReader) | |
518 | { | |
5d950f54 | 519 | /// Convert raw data to SDigit |
ca8c8223 | 520 | |
241560c2 | 521 | if (!fLoader->TreeS()) fLoader->MakeSDigitsContainer(); |
ca8c8223 | 522 | |
7435e1f8 | 523 | TTree* treeS = fLoader->TreeS(); |
524 | ||
ca8c8223 | 525 | AliMUONVDigitStore* sDigitStore = AliMUONVDigitStore::Create(DigitStoreClassName()); |
526 | ||
7435e1f8 | 527 | sDigitStore->Connect(*treeS); |
528 | ||
ca8c8223 | 529 | if (!fDigitMaker) fDigitMaker = new AliMUONDigitMaker; |
5d950f54 | 530 | |
531 | if (!fDigitCalibrator) | |
532 | { | |
533 | AliMUONRecoParam* recoParam = 0x0; | |
534 | ||
535 | AliCDBEntry* entry = AliCDBManager::Instance()->Get("MUON/Calib/RecoParam"); | |
536 | ||
537 | if (entry) | |
538 | { | |
539 | // load recoParam according OCDB content (single or array) | |
540 | if (!(recoParam = dynamic_cast<AliMUONRecoParam*>(entry->GetObject()))) | |
541 | { | |
542 | TObjArray* recoParamArray = static_cast<TObjArray*>(entry->GetObject()); | |
543 | ||
544 | for(Int_t i = 0; i < recoParamArray->GetEntriesFast(); ++i) | |
545 | { | |
546 | recoParam = static_cast<AliMUONRecoParam*>(recoParamArray->UncheckedAt(i)); | |
29464317 | 547 | if (recoParam && recoParam->IsDefault()) break; |
5d950f54 | 548 | recoParam = 0x0; |
549 | } | |
550 | } | |
551 | } | |
552 | ||
29464317 | 553 | if (!recoParam) |
554 | { | |
555 | AliFatal("Cannot work without recoparams !"); | |
556 | } | |
557 | ||
5d950f54 | 558 | TString calibMode = recoParam->GetCalibrationMode(); |
559 | ||
560 | fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,recoParam,calibMode.Data()); | |
561 | } | |
562 | ||
563 | fDigitMaker->Raw2Digits(rawReader,sDigitStore,0x0); | |
564 | ||
565 | fDigitCalibrator->Calibrate(*sDigitStore); | |
566 | ||
567 | TIter next(sDigitStore->CreateIterator()); | |
568 | AliMUONDigit* sdigit; | |
569 | ||
570 | // now tweak the digits to make them "as fresh as possible", i.e. | |
571 | // reset their calibrated status, as they'll be calibrated again | |
572 | // once embedded. | |
573 | while ( ( sdigit = static_cast<AliMUONDigit*>(next()) ) ) | |
574 | { | |
575 | sdigit->Calibrated(kFALSE); | |
5d950f54 | 576 | } |
577 | ||
7ead8580 | 578 | treeS->Fill(); |
5d950f54 | 579 | |
241560c2 | 580 | fLoader->WriteSDigits("OVERWRITE"); |
ca8c8223 | 581 | |
241560c2 | 582 | fLoader->UnloadSDigits(); |
ca8c8223 | 583 | |
7435e1f8 | 584 | delete sDigitStore; |
585 | ||
241560c2 | 586 | return kTRUE; |
241560c2 | 587 | } |
588 | ||
ce3f5e87 | 589 | //_______________________________________________________________________ |
3fa6cfdd | 590 | AliLoader* AliMUON::MakeLoader(const char* topfoldername) |
591 | { | |
d19b6003 | 592 | /// Build standard getter (AliLoader type); |
593 | /// if detector wants to use castomized getter, it must overload this method | |
8c343c7c | 594 | |
595 | AliDebug(1,Form("Creating standard getter for detector %s. Top folder is %s.", | |
596 | GetName(),topfoldername)); | |
128843d9 | 597 | fLoader = new AliLoader(GetName(),topfoldername); |
241560c2 | 598 | |
3fa6cfdd | 599 | return fLoader; |
600 | } | |
ffd9faa2 | 601 | |
d5609cfc | 602 | //________________________________________________________________________ |
603 | void | |
604 | AliMUON::ResetGeometryBuilder() | |
605 | { | |
d19b6003 | 606 | /// Only to be used by "experts" wanting to change the geometry builders |
607 | /// to be used. | |
608 | /// As the ctor of AliMUON now defines a default geometrybuilder, this | |
609 | /// ResetGeometryBuilder() must be called prior to call the | |
610 | /// AddGeometryBuilder() | |
611 | ||
d5609cfc | 612 | delete fGeometryBuilder; |
613 | fGeometryBuilder = new AliMUONGeometryBuilder(this); | |
614 | fGeometryBuilder | |
615 | ->AddBuilder(new AliMUONCommonGeometryBuilder(this)); | |
616 | } | |
44b96781 | 617 | |
618 | //____________________________________________________________________ | |
619 | Bool_t AliMUON::GetTriggerResponseV1() const | |
620 | { | |
621 | /// | |
622 | /// Returns fTriggerResponseV1 | |
623 | /// | |
624 | return fTriggerResponseV1; | |
625 | ||
626 | } | |
627 | ||
e93b11d0 | 628 | //____________________________________________________________________ |
629 | Int_t AliMUON::GetTriggerCoinc44() const | |
630 | { | |
631 | /// | |
632 | /// Returns fTriggerCoinc44 | |
633 | /// | |
634 | return fTriggerCoinc44; | |
635 | ||
afb3ccf0 | 636 | } |
637 | ||
638 | //____________________________________________________________________ | |
88570609 | 639 | Bool_t AliMUON::GetTriggerEffCells() const |
afb3ccf0 | 640 | { |
641 | /// | |
642 | /// Returns fTriggerEffCells | |
643 | /// | |
644 | return fTriggerEffCells; | |
645 | ||
e93b11d0 | 646 | } |
647 | ||
a3249004 | 648 | //____________________________________________________________________ |
8c0b5e70 | 649 | Int_t AliMUON::GetDigitizerWithNoise() const |
a3249004 | 650 | { |
651 | /// | |
652 | /// Returns fDigitizerWithNoise | |
653 | /// | |
654 | return fDigitizerWithNoise; | |
655 | ||
656 | } | |
657 | ||
b6c94614 | 658 |