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