]>
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 | ||
d19b6003 | 18 | // ------------------ |
19 | // Class AliMUON | |
20 | // ------------------ | |
21 | // AliDetector class for MUON subsystem | |
22 | // providing simulation data management | |
fe4da5cc | 23 | |
88cb7938 | 24 | #include "Riostream.h" |
25 | ||
26 | #include <AliPDG.h> | |
a897a37a | 27 | #include <TBRIK.h> |
88cb7938 | 28 | #include <TCanvas.h> |
29 | #include <TDirectory.h> | |
30 | #include <TFile.h> | |
94de3818 | 31 | #include <TGeometry.h> |
88cb7938 | 32 | #include <TMinuit.h> |
fe4da5cc | 33 | #include <TNode.h> |
88cb7938 | 34 | #include <TNtuple.h> |
fe4da5cc | 35 | #include <TObjArray.h> |
88cb7938 | 36 | #include <TObject.h> |
37 | #include <TObjectTable.h> | |
38 | #include <TPad.h> | |
a897a37a | 39 | #include <TParticle.h> |
40 | #include <TROOT.h> | |
88cb7938 | 41 | #include <TRandom.h> |
42 | #include <TRotMatrix.h> | |
43 | #include <TTUBE.h> | |
a9e2aefa | 44 | #include <TTUBE.h> |
88cb7938 | 45 | #include <TTree.h> |
46 | #include <TVector.h> | |
47 | #include <TVirtualMC.h> | |
fe4da5cc | 48 | |
d4bb94a1 | 49 | //#include "AliHeader.h" |
88cb7938 | 50 | #include "AliLoader.h" |
dbb4e169 | 51 | #include "AliRunDigitizer.h" |
307d9d04 | 52 | #include "AliMC.h" |
fac3a970 | 53 | #include "AliRun.h" |
fe4da5cc | 54 | #include "AliMUON.h" |
88cb7938 | 55 | #include "AliMUONChamberTrigger.h" |
88cb7938 | 56 | #include "AliMUONConstants.h" |
ffd9faa2 | 57 | #include "AliMUONHit.h" |
a9e2aefa | 58 | #include "AliMUONRawCluster.h" |
88cb7938 | 59 | #include "AliMUONTransientDigit.h" |
ecfa008b | 60 | #include "AliMUONTriggerCircuit.h" |
0c527060 | 61 | #include "AliMUONTriggerCircuitNew.h" |
504d0837 | 62 | #include "AliMUONGeometry.h" |
63 | #include "AliMUONGeometryTransformer.h" | |
d4bb94a1 | 64 | #include "AliMUONGeometryBuilder.h" |
e118b27e | 65 | #include "AliMUONCommonGeometryBuilder.h" |
d1cd2474 | 66 | #include "AliMUONVGeometryBuilder.h" |
a713db22 | 67 | #include "AliMUONGeometrySegmentation.h" |
dbb4e169 | 68 | #include "AliMUONDigitizerv2.h" |
d1775029 | 69 | #include "AliMUONSDigitizerv1.h" |
a19e2543 | 70 | #include "AliMUONRawWriter.h" |
504d0837 | 71 | #include "AliMUONSegmentation.h" |
8c343c7c | 72 | #include "AliLog.h" |
a9e2aefa | 73 | |
68585390 | 74 | #include "AliMUONSDigitizerV2.h" |
75 | #include "AliMUONDigitizerV3.h" | |
241560c2 | 76 | #include "AliMUONDigitMaker.h" |
68585390 | 77 | |
d5609cfc | 78 | #include "AliMUONSt1GeometryBuilderV2.h" |
79 | #include "AliMUONSt2GeometryBuilderV2.h" | |
80 | #include "AliMUONSlatGeometryBuilder.h" | |
81 | #include "AliMUONTriggerGeometryBuilder.h" | |
82 | ||
a9e2aefa | 83 | // Defaults parameters for Z positions of chambers |
84 | // taken from values for "stations" in AliMUON::AliMUON | |
85 | // const Float_t zch[7]={528, 690., 975., 1249., 1449., 1610, 1710.}; | |
86 | // and from array "dstation" in AliMUONv1::CreateGeometry | |
87 | // Float_t dstation[5]={20., 20., 20, 20., 20.}; | |
88 | // for tracking chambers, | |
89 | // according to (Z1 = zch - dstation) and (Z2 = zch + dstation) | |
90 | // for the first and second chambers in the station, respectively, | |
91 | // and from "DTPLANES" in AliMUONv1::CreateGeometry | |
92 | // const Float_t DTPLANES = 15.; | |
93 | // for trigger chambers, | |
94 | // according to (Z1 = zch) and (Z2 = zch + DTPLANES) | |
95 | // for the first and second chambers in the station, respectively | |
fe4da5cc | 96 | |
13985652 | 97 | /// \cond CLASSIMP |
98 | ClassImp(AliMUON) | |
99 | /// \endcond | |
30178c30 | 100 | |
ce3f5e87 | 101 | //__________________________________________________________________ |
fe4da5cc | 102 | AliMUON::AliMUON() |
30178c30 | 103 | : AliDetector(), |
104 | fNCh(0), | |
105 | fNTrackingCh(0), | |
106 | fMUONData(0), | |
107 | fSplitLevel(0), | |
108 | fChambers(0), | |
30178c30 | 109 | fTriggerCircuits(0), |
0c527060 | 110 | fTriggerCircuitsNew(0), |
d4bb94a1 | 111 | fGeometryBuilder(0), |
504d0837 | 112 | fSegmentation(0), |
30178c30 | 113 | fAccCut(kFALSE), |
114 | fAccMin(0.), | |
115 | fAccMax(0.), | |
116 | fMaxStepGas(0.), | |
117 | fMaxStepAlu(0.), | |
118 | fMaxDestepGas(0.), | |
119 | fMaxDestepAlu(0.), | |
120 | fMaxIterPad(0), | |
ced309a5 | 121 | fCurIterPad(0), |
68585390 | 122 | fTriggerScalerEvent(kFALSE), |
e93b11d0 | 123 | fTriggerResponseV1(kFALSE), |
124 | fTriggerCoinc44(0), | |
afb3ccf0 | 125 | fTriggerEffCells(0), |
68585390 | 126 | fSDigitizerType(""), |
d5609cfc | 127 | fDigitizerType(""), |
241560c2 | 128 | fRawWriter(0x0), |
129 | fDigitMaker(0x0) | |
130 | ||
fe4da5cc | 131 | { |
d19b6003 | 132 | /// Default Constructor |
133 | ||
134 | AliDebug(1,Form("default (empty) ctor this=%p",this)); | |
1bd26093 | 135 | fIshunt = 0; |
fe4da5cc | 136 | } |
30178c30 | 137 | |
ce3f5e87 | 138 | //__________________________________________________________________ |
68585390 | 139 | AliMUON::AliMUON(const char *name, const char *title, |
140 | const char* sDigitizerClassName, | |
141 | const char* digitizerClassName) | |
30178c30 | 142 | : AliDetector(name,title), |
143 | fNCh(AliMUONConstants::NCh()), | |
144 | fNTrackingCh(AliMUONConstants::NTrackingCh()), | |
145 | fMUONData(0), | |
146 | fSplitLevel(0), | |
147 | fChambers(0), | |
30178c30 | 148 | fTriggerCircuits(0), |
0c527060 | 149 | fTriggerCircuitsNew(0), |
d4bb94a1 | 150 | fGeometryBuilder(0), |
504d0837 | 151 | fSegmentation(0), |
30178c30 | 152 | fAccCut(kFALSE), |
153 | fAccMin(0.), | |
154 | fAccMax(0.), | |
155 | fMaxStepGas(0.1), | |
156 | fMaxStepAlu(0.1), | |
157 | fMaxDestepGas(-1), // Negatives values are ignored by geant3 CONS200 | |
158 | fMaxDestepAlu(-1), // in the calculation of the tracking parameters | |
159 | fMaxIterPad(0), | |
ced309a5 | 160 | fCurIterPad(0), |
e93b11d0 | 161 | fTriggerScalerEvent(kFALSE), |
162 | fTriggerResponseV1(kFALSE), | |
163 | fTriggerCoinc44(0), | |
afb3ccf0 | 164 | fTriggerEffCells(0), |
68585390 | 165 | fSDigitizerType(sDigitizerClassName), |
d5609cfc | 166 | fDigitizerType(digitizerClassName), |
241560c2 | 167 | fRawWriter(0x0), |
168 | fDigitMaker(new AliMUONDigitMaker(kFALSE)) | |
fe4da5cc | 169 | { |
d19b6003 | 170 | /// Standard constructor |
171 | ||
172 | AliDebug(1,Form("ctor this=%p",this)); | |
30178c30 | 173 | fIshunt = 0; |
a897a37a | 174 | |
ce3f5e87 | 175 | SetMarkerColor(kRed);// |
e118b27e | 176 | |
177 | // Geometry builder | |
178 | fGeometryBuilder = new AliMUONGeometryBuilder(this); | |
179 | ||
180 | // Common geometry definitions | |
181 | fGeometryBuilder | |
182 | ->AddBuilder(new AliMUONCommonGeometryBuilder(this)); | |
183 | ||
d5609cfc | 184 | // By default, add also all the needed geometry builders. |
185 | // If you want to change this from outside, please use ResetGeometryBuilder | |
186 | // method, followed by AddGeometryBuilder ones. | |
187 | ||
188 | AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(this)); | |
189 | AddGeometryBuilder(new AliMUONSt2GeometryBuilderV2(this)); | |
190 | AddGeometryBuilder(new AliMUONSlatGeometryBuilder(this)); | |
191 | AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(this)); | |
192 | ||
193 | // | |
194 | // Creating List of Chambers | |
a9e2aefa | 195 | Int_t ch; |
f665c1ea | 196 | fChambers = new TObjArray(AliMUONConstants::NCh()); |
d1cd2474 | 197 | |
a9e2aefa | 198 | // Loop over stations |
f665c1ea | 199 | for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) { |
a9e2aefa | 200 | // Loop over 2 chambers in the station |
ce3f5e87 | 201 | for (Int_t stCH = 0; stCH < 2; stCH++) { |
202 | // | |
203 | // | |
204 | // Default Parameters for Muon Tracking Stations | |
205 | ch = 2 * st + stCH; | |
206 | if (ch < AliMUONConstants::NTrackingCh()) { | |
207 | fChambers->AddAt(new AliMUONChamber(ch),ch); | |
208 | } else { | |
504d0837 | 209 | fChambers->AddAt(new AliMUONChamberTrigger(ch, GetGeometryTransformer()),ch); |
ce3f5e87 | 210 | } |
ce3f5e87 | 211 | } // Chamber stCH (0, 1) in |
a9e2aefa | 212 | } // Station st (0...) |
ce3f5e87 | 213 | |
ce3f5e87 | 214 | // cp new design of AliMUONTriggerDecision |
215 | fTriggerCircuits = new TObjArray(AliMUONConstants::NTriggerCircuit()); | |
216 | for (Int_t circ=0; circ<AliMUONConstants::NTriggerCircuit(); circ++) { | |
217 | fTriggerCircuits->AddAt(new AliMUONTriggerCircuit(),circ); | |
218 | } | |
0c527060 | 219 | |
220 | fTriggerCircuitsNew = new TObjArray(AliMUONConstants::NTriggerCircuit()); | |
221 | for (Int_t circ=0; circ<AliMUONConstants::NTriggerCircuit(); circ++) { | |
222 | fTriggerCircuitsNew->AddAt(new AliMUONTriggerCircuitNew(),circ); | |
223 | } | |
fe4da5cc | 224 | } |
30178c30 | 225 | |
ce3f5e87 | 226 | //____________________________________________________________________ |
fe4da5cc | 227 | AliMUON::~AliMUON() |
228 | { | |
d19b6003 | 229 | /// Destructor |
230 | ||
edee5e63 | 231 | AliDebug(1,Form("dtor this=%p",this)); |
ce3f5e87 | 232 | fIshunt = 0; |
d1cd2474 | 233 | |
c6df4ef2 | 234 | if (fChambers){ |
235 | fChambers->Delete(); | |
236 | delete fChambers; | |
237 | } | |
238 | if (fTriggerCircuits){ | |
239 | fTriggerCircuits->Delete(); | |
240 | delete fTriggerCircuits; | |
241 | } | |
0c527060 | 242 | if (fTriggerCircuitsNew){ |
243 | fTriggerCircuitsNew->Delete(); | |
244 | delete fTriggerCircuitsNew; | |
245 | } | |
246 | ||
c6df4ef2 | 247 | delete fMUONData; |
d4bb94a1 | 248 | delete fGeometryBuilder; |
504d0837 | 249 | delete fSegmentation; |
d5609cfc | 250 | delete fRawWriter; |
241560c2 | 251 | delete fDigitMaker; |
d1cd2474 | 252 | } |
30178c30 | 253 | |
d1cd2474 | 254 | //_____________________________________________________________________________ |
255 | void AliMUON::AddGeometryBuilder(AliMUONVGeometryBuilder* geomBuilder) | |
256 | { | |
d19b6003 | 257 | /// Add the geometry builder to the list |
d1cd2474 | 258 | |
d4bb94a1 | 259 | fGeometryBuilder->AddBuilder(geomBuilder); |
a897a37a | 260 | } |
c9d10ab5 | 261 | |
ce3f5e87 | 262 | //____________________________________________________________________ |
fe4da5cc | 263 | void AliMUON::BuildGeometry() |
264 | { | |
d19b6003 | 265 | /// Geometry for event display |
c9d10ab5 | 266 | |
002920d1 | 267 | |
ae89d471 | 268 | // for (Int_t i = 0; i < AliMUONConstants::NCh(); i++) |
269 | // this->Chamber(i).SegmentationModel2(1)->Draw("eventdisplay");// to be check ! | |
270 | ||
002920d1 | 271 | |
fe4da5cc | 272 | } |
c9d10ab5 | 273 | |
504d0837 | 274 | //____________________________________________________________________ |
275 | const AliMUONGeometry* AliMUON::GetGeometry() const | |
276 | { | |
d19b6003 | 277 | /// Return geometry parametrisation |
504d0837 | 278 | |
279 | if ( !fGeometryBuilder) { | |
280 | AliWarningStream() << "GeometryBuilder not defined." << std::endl; | |
281 | return 0; | |
282 | } | |
283 | ||
284 | return fGeometryBuilder->GetGeometry(); | |
285 | } | |
286 | ||
287 | //____________________________________________________________________ | |
288 | const AliMUONGeometryTransformer* AliMUON::GetGeometryTransformer() const | |
289 | { | |
d19b6003 | 290 | /// Return geometry parametrisation |
504d0837 | 291 | |
292 | const AliMUONGeometry* kGeometry = GetGeometry(); | |
293 | ||
294 | if ( !kGeometry) return 0; | |
295 | ||
296 | return kGeometry->GetTransformer(); | |
297 | } | |
298 | ||
ce3f5e87 | 299 | //__________________________________________________________________ |
300 | void AliMUON::SetTreeAddress() | |
a897a37a | 301 | { |
d19b6003 | 302 | /// Set Hits tree address |
303 | ||
ce3f5e87 | 304 | GetMUONData()->SetLoader(fLoader); |
d1775029 | 305 | // GetMUONData()->MakeBranch("D,S,RC"); |
306 | // GetMUONData()->SetTreeAddress("H,D,S,RC"); | |
52c9bc11 | 307 | GetMUONData()->SetTreeAddress("H"); |
307d9d04 | 308 | if (fHits != GetMUONData()->Hits()) { |
ae31c826 | 309 | if ( gAlice->GetMCApp() ) |
6d2f7cbd | 310 | if ( gAlice->GetMCApp()->GetHitLists() ) { |
311 | fHits = GetMUONData()->Hits(); | |
312 | gAlice->GetMCApp()->AddHitList(fHits); // For purifyKine, only necessary when Hit list is created in AliMUONData | |
313 | } | |
307d9d04 | 314 | } |
6d2f7cbd | 315 | fHits = GetMUONData()->Hits(); // Added by Ivana to use the methods FisrtHit, NextHit of AliDetector |
a9e2aefa | 316 | } |
317 | ||
ce3f5e87 | 318 | //_________________________________________________________________ |
a897a37a | 319 | void AliMUON::SetChargeSlope(Int_t id, Float_t p1) |
fe4da5cc | 320 | { |
d19b6003 | 321 | /// Set the inverse charge slope for chamber id |
322 | ||
ce3f5e87 | 323 | Int_t i=2*(id-1); //PH ((AliMUONChamber*) (*fChambers)[i])->SetSigmaIntegration(p1); |
324 | //PH ((AliMUONChamber*) (*fChambers)[i+1])->SetSigmaIntegration(p1); | |
2682e810 | 325 | ((AliMUONChamber*) fChambers->At(i))->SetChargeSlope(p1); |
326 | ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSlope(p1); | |
fe4da5cc | 327 | } |
ce3f5e87 | 328 | //__________________________________________________________________ |
a897a37a | 329 | void AliMUON::SetChargeSpread(Int_t id, Float_t p1, Float_t p2) |
fe4da5cc | 330 | { |
d19b6003 | 331 | /// Set sigma of charge spread for chamber id |
332 | ||
fe4da5cc | 333 | Int_t i=2*(id-1); |
2682e810 | 334 | ((AliMUONChamber*) fChambers->At(i))->SetChargeSpread(p1,p2); |
335 | ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSpread(p1,p2); | |
fe4da5cc | 336 | } |
ce3f5e87 | 337 | //___________________________________________________________________ |
a897a37a | 338 | void AliMUON::SetSigmaIntegration(Int_t id, Float_t p1) |
fe4da5cc | 339 | { |
d19b6003 | 340 | /// Set integration limits for charge spread |
fe4da5cc | 341 | Int_t i=2*(id-1); |
2682e810 | 342 | ((AliMUONChamber*) fChambers->At(i))->SetSigmaIntegration(p1); |
343 | ((AliMUONChamber*) fChambers->At(i+1))->SetSigmaIntegration(p1); | |
fe4da5cc | 344 | } |
345 | ||
ce3f5e87 | 346 | //__________________________________________________________________ |
d09fafb0 | 347 | void AliMUON::SetMaxAdc(Int_t id, Int_t p1) |
fe4da5cc | 348 | { |
d19b6003 | 349 | /// Set maximum number for ADCcounts (saturation) |
350 | ||
fe4da5cc | 351 | Int_t i=2*(id-1); |
2682e810 | 352 | ((AliMUONChamber*) fChambers->At(i))->SetMaxAdc(p1); |
353 | ((AliMUONChamber*) fChambers->At(i+1))->SetMaxAdc(p1); | |
fe4da5cc | 354 | } |
d4bb94a1 | 355 | |
ce3f5e87 | 356 | //__________________________________________________________________ |
a897a37a | 357 | void AliMUON::SetMaxStepGas(Float_t p1) |
fe4da5cc | 358 | { |
d19b6003 | 359 | /// Set stepsize in gas |
360 | ||
ce3f5e87 | 361 | fMaxStepGas=p1; |
fe4da5cc | 362 | } |
ce3f5e87 | 363 | //__________________________________________________________________ |
a897a37a | 364 | void AliMUON::SetMaxStepAlu(Float_t p1) |
fe4da5cc | 365 | { |
d19b6003 | 366 | /// Set step size in Alu |
367 | ||
fe4da5cc | 368 | fMaxStepAlu=p1; |
369 | } | |
ce3f5e87 | 370 | //__________________________________________________________________ |
a897a37a | 371 | void AliMUON::SetMaxDestepGas(Float_t p1) |
fe4da5cc | 372 | { |
d19b6003 | 373 | /// Set maximum step size in Gas |
374 | ||
fe4da5cc | 375 | fMaxDestepGas=p1; |
376 | } | |
ce3f5e87 | 377 | //__________________________________________________________________ |
a897a37a | 378 | void AliMUON::SetMaxDestepAlu(Float_t p1) |
fe4da5cc | 379 | { |
d19b6003 | 380 | /// Set maximum step size in Alu |
381 | ||
ce3f5e87 | 382 | fMaxDestepAlu=p1; |
fe4da5cc | 383 | } |
d4bb94a1 | 384 | |
d1cd2474 | 385 | //____________________________________________________________________ |
386 | Float_t AliMUON::GetMaxStepGas() const | |
387 | { | |
d19b6003 | 388 | /// Return stepsize in gas |
d1cd2474 | 389 | |
390 | return fMaxStepGas; | |
391 | } | |
392 | ||
393 | //____________________________________________________________________ | |
394 | Float_t AliMUON::GetMaxStepAlu() const | |
395 | { | |
d19b6003 | 396 | /// Return step size in Alu |
d1cd2474 | 397 | |
398 | return fMaxStepAlu; | |
399 | } | |
400 | ||
401 | //____________________________________________________________________ | |
402 | Float_t AliMUON::GetMaxDestepGas() const | |
403 | { | |
d19b6003 | 404 | /// Return maximum step size in Gas |
d1cd2474 | 405 | |
406 | return fMaxDestepGas; | |
407 | } | |
408 | ||
409 | //____________________________________________________________________ | |
410 | Float_t AliMUON::GetMaxDestepAlu() const | |
411 | { | |
d19b6003 | 412 | /// Return maximum step size in Gas |
d1cd2474 | 413 | |
414 | return fMaxDestepAlu; | |
415 | } | |
d4bb94a1 | 416 | |
883746f3 | 417 | //____________________________________________________________________ |
418 | void AliMUON::SetAlign(Bool_t align) | |
a713db22 | 419 | { |
d19b6003 | 420 | /// Set option for alignement to geometry builder |
883746f3 | 421 | |
422 | fGeometryBuilder->SetAlign(align); | |
423 | } | |
fe4da5cc | 424 | |
82d1ac0a | 425 | //____________________________________________________________________ |
426 | void AliMUON::SetAlign(const TString& fileName, Bool_t align) | |
427 | { | |
d19b6003 | 428 | /// Set option for alignement to geometry builder |
82d1ac0a | 429 | |
430 | fGeometryBuilder->SetAlign(fileName, align); | |
431 | } | |
432 | ||
ce3f5e87 | 433 | //____________________________________________________________________ |
a9e2aefa | 434 | void AliMUON::SetResponseModel(Int_t id, AliMUONResponse *response) |
fe4da5cc | 435 | { |
d19b6003 | 436 | /// Set the response for chamber id |
2682e810 | 437 | ((AliMUONChamber*) fChambers->At(id))->SetResponseModel(response); |
fe4da5cc | 438 | } |
d19b6003 | 439 | |
ce3f5e87 | 440 | //____________________________________________________________________ |
c92eb8ad | 441 | AliDigitizer* AliMUON::CreateDigitizer(AliRunDigitizer* manager) const |
85a5290f | 442 | { |
d19b6003 | 443 | /// FIXME: the selection of the class should be done through a factory |
444 | /// mechanism. (see also Hits2SDigits()). | |
68585390 | 445 | |
446 | AliInfo(Form("Digitizer used : %s",fDigitizerType.Data())); | |
447 | ||
448 | if ( fDigitizerType == "digitizer:default" ) | |
449 | { | |
450 | return new AliMUONDigitizerv2(manager); | |
451 | } | |
452 | else if ( fDigitizerType == "digitizer:NewDigitizerNewTrigger" ) | |
453 | { | |
afb3ccf0 | 454 | return new AliMUONDigitizerV3(manager,AliMUONDigitizerV3::kTriggerElectronics,kTRUE); |
68585390 | 455 | } |
456 | else if ( fDigitizerType == "digitizer:NewDigitizerOldTrigger" ) | |
457 | { | |
afb3ccf0 | 458 | return new AliMUONDigitizerV3(manager,AliMUONDigitizerV3::kTriggerDecision, kFALSE); |
68585390 | 459 | } |
4142b82d | 460 | else if ( fDigitizerType == "digitizer:NewDigitizerWithNoiseOldTrigger" ) |
461 | { | |
afb3ccf0 | 462 | return new AliMUONDigitizerV3(manager,AliMUONDigitizerV3::kTriggerDecision, kTRUE); |
4142b82d | 463 | } |
68585390 | 464 | else |
465 | { | |
466 | AliFatal(Form("Unknown digitizer type : %s",fDigitizerType.Data())); | |
467 | } | |
468 | return 0x0; | |
469 | } | |
470 | ||
471 | //_____________________________________________________________________ | |
472 | TString | |
473 | AliMUON::SDigitizerType() const | |
474 | { | |
d19b6003 | 475 | /// Return digitizer type |
476 | ||
68585390 | 477 | return fSDigitizerType; |
85a5290f | 478 | } |
68585390 | 479 | |
ce3f5e87 | 480 | //_____________________________________________________________________ |
2ab0c725 | 481 | void AliMUON::SDigits2Digits() |
482 | { | |
d19b6003 | 483 | /// Write TreeD here only |
d963c261 | 484 | |
d963c261 | 485 | char hname[30]; |
88cb7938 | 486 | // sprintf(hname,"TreeD%d",fLoader->GetHeader()->GetEvent()); |
487 | fLoader->TreeD()->Write(hname,TObject::kOverwrite); | |
488 | fLoader->TreeD()->Reset(); | |
2ab0c725 | 489 | } |
a9e2aefa | 490 | |
d1775029 | 491 | //_____________________________________________________________________ |
492 | void AliMUON::Hits2SDigits() | |
493 | { | |
d19b6003 | 494 | /// FIXME: the selection of the sdigitizer should be done through a |
495 | /// factory mechanism. | |
68585390 | 496 | |
497 | AliInfo(Form("SDigitizer used : %s",fSDigitizerType.Data())); | |
498 | ||
499 | if ( fSDigitizerType == "sdigitizer:default" ) | |
500 | { | |
501 | // Adaption of AliMUONSDigitizerv1 to be excuted by the AliSimulation framework | |
502 | AliRunLoader* runLoader = fLoader->GetRunLoader(); | |
503 | AliRunDigitizer * manager = new AliRunDigitizer(1,1); | |
504 | manager->SetInputStream(0,runLoader->GetFileName(),AliConfig::GetDefaultEventFolderName()); | |
505 | AliMUONDigitizer * dMUON = new AliMUONSDigitizerv1(manager); | |
506 | fLoader->LoadHits("READ"); | |
507 | for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++) { | |
508 | runLoader->GetEvent(iEvent); | |
509 | dMUON->Exec(""); | |
510 | } | |
511 | fLoader->UnloadHits(); | |
512 | } | |
513 | else if ( fSDigitizerType == "sdigitizer:AliMUONSDigitizerV2" ) | |
514 | { | |
515 | TTask* sdigitizer = new AliMUONSDigitizerV2; | |
516 | sdigitizer->ExecuteTask(); | |
dbb4e169 | 517 | } |
68585390 | 518 | else |
519 | { | |
520 | AliFatal(Form("Unknown sdigitizer classname : %s",fSDigitizerType.Data())); | |
521 | } | |
522 | } | |
523 | ||
524 | //_____________________________________________________________________ | |
525 | TString | |
526 | AliMUON::DigitizerType() const | |
527 | { | |
d19b6003 | 528 | /// Return digitizer type |
529 | ||
68585390 | 530 | return fDigitizerType; |
d1775029 | 531 | } |
68585390 | 532 | |
39e39255 | 533 | //_____________________________________________________________________ |
534 | void AliMUON::Digits2Raw() | |
535 | { | |
d19b6003 | 536 | /// Convert digits of the current event to raw data |
537 | ||
d5609cfc | 538 | if (!fRawWriter) |
539 | { | |
540 | fRawWriter = new AliMUONRawWriter(fMUONData); | |
541 | if (fTriggerScalerEvent == kTRUE) | |
542 | { | |
84ceeb06 | 543 | fRawWriter->SetScalersNumbers(); |
d5609cfc | 544 | } |
545 | } | |
546 | ||
547 | if (!fRawWriter->Digits2Raw()) | |
548 | { | |
549 | AliError("pb writting raw data"); | |
550 | } | |
39e39255 | 551 | } |
68585390 | 552 | |
241560c2 | 553 | //_____________________________________________________________________ |
554 | Bool_t AliMUON::Raw2SDigits(AliRawReader* rawReader) | |
555 | { | |
556 | /// Convert raw data to SDigit | |
557 | /// Only for tracking for the moment (ChF) | |
558 | ||
559 | //fLoader->LoadDigits("READ"); | |
560 | if (!fLoader->TreeS()) fLoader->MakeSDigitsContainer(); | |
561 | ||
562 | fMUONData->MakeBranch("S"); | |
563 | fMUONData->SetTreeAddress("S"); | |
564 | fDigitMaker->Raw2Digits(rawReader); | |
565 | fMUONData->Fill("S"); | |
566 | ||
567 | fLoader->WriteSDigits("OVERWRITE"); | |
568 | fMUONData->ResetSDigits(); | |
569 | fLoader->UnloadSDigits(); | |
570 | ||
571 | return kTRUE; | |
572 | ||
573 | } | |
574 | ||
ce3f5e87 | 575 | //_______________________________________________________________________ |
3fa6cfdd | 576 | AliLoader* AliMUON::MakeLoader(const char* topfoldername) |
577 | { | |
d19b6003 | 578 | /// Build standard getter (AliLoader type); |
579 | /// if detector wants to use castomized getter, it must overload this method | |
8c343c7c | 580 | |
581 | AliDebug(1,Form("Creating standard getter for detector %s. Top folder is %s.", | |
582 | GetName(),topfoldername)); | |
128843d9 | 583 | fLoader = new AliLoader(GetName(),topfoldername); |
ce3f5e87 | 584 | fMUONData = new AliMUONData(fLoader,GetName(),GetName()); |
d652f85c | 585 | fMUONData->SetSplitLevel(fSplitLevel); |
241560c2 | 586 | |
587 | fDigitMaker->SetMUONData(fMUONData); | |
588 | ||
3fa6cfdd | 589 | return fLoader; |
590 | } | |
ce3f5e87 | 591 | //_______________________________________________________________________ |
a897a37a | 592 | |
593 | AliMUONRawCluster *AliMUON::RawCluster(Int_t ichamber, Int_t icathod, Int_t icluster) | |
594 | { | |
d19b6003 | 595 | /// Return rawcluster (icluster) for chamber ichamber and cathode icathod |
596 | /// Obsolete ?? | |
597 | ||
ce3f5e87 | 598 | TClonesArray *muonRawCluster = GetMUONData()->RawClusters(ichamber); |
a897a37a | 599 | ResetRawClusters(); |
88cb7938 | 600 | TTree *treeR = fLoader->TreeR(); |
a9e2aefa | 601 | Int_t nent=(Int_t)treeR->GetEntries(); |
602 | treeR->GetEvent(nent-2+icathod-1); | |
603 | //treeR->GetEvent(icathod); | |
604 | //Int_t nrawcl = (Int_t)muonRawCluster->GetEntriesFast(); | |
a897a37a | 605 | |
a9e2aefa | 606 | AliMUONRawCluster * mRaw = (AliMUONRawCluster*)muonRawCluster->UncheckedAt(icluster); |
a897a37a | 607 | //printf("RawCluster _ nent nrawcl icluster mRaw %d %d %d%p\n",nent,nrawcl,icluster,mRaw); |
608 | ||
609 | return mRaw; | |
610 | } | |
ffd9faa2 | 611 | |
d5609cfc | 612 | //________________________________________________________________________ |
613 | void | |
614 | AliMUON::ResetGeometryBuilder() | |
615 | { | |
d19b6003 | 616 | /// Only to be used by "experts" wanting to change the geometry builders |
617 | /// to be used. | |
618 | /// As the ctor of AliMUON now defines a default geometrybuilder, this | |
619 | /// ResetGeometryBuilder() must be called prior to call the | |
620 | /// AddGeometryBuilder() | |
621 | ||
d5609cfc | 622 | delete fGeometryBuilder; |
623 | fGeometryBuilder = new AliMUONGeometryBuilder(this); | |
624 | fGeometryBuilder | |
625 | ->AddBuilder(new AliMUONCommonGeometryBuilder(this)); | |
626 | } | |
44b96781 | 627 | |
628 | //____________________________________________________________________ | |
629 | Bool_t AliMUON::GetTriggerResponseV1() const | |
630 | { | |
631 | /// | |
632 | /// Returns fTriggerResponseV1 | |
633 | /// | |
634 | return fTriggerResponseV1; | |
635 | ||
636 | } | |
637 | ||
e93b11d0 | 638 | //____________________________________________________________________ |
639 | Int_t AliMUON::GetTriggerCoinc44() const | |
640 | { | |
641 | /// | |
642 | /// Returns fTriggerCoinc44 | |
643 | /// | |
644 | return fTriggerCoinc44; | |
645 | ||
afb3ccf0 | 646 | } |
647 | ||
648 | //____________________________________________________________________ | |
88570609 | 649 | Bool_t AliMUON::GetTriggerEffCells() const |
afb3ccf0 | 650 | { |
651 | /// | |
652 | /// Returns fTriggerEffCells | |
653 | /// | |
654 | return fTriggerEffCells; | |
655 | ||
e93b11d0 | 656 | } |
657 |