]>
Commit | Line | Data |
---|---|---|
13985652 | 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 | ||
16 | /* $Id$ */ | |
48b32e42 | 17 | |
48b32e42 | 18 | #include "AliMUONDataInterface.h" |
e9bef706 | 19 | #include "AliMUONDigit.h" |
20 | #include "AliMUONGeometryTransformer.h" | |
554b38a6 | 21 | #include "AliMUONGlobalTrigger.h" |
30178c30 | 22 | #include "AliMUONHit.h" |
e9bef706 | 23 | #include "AliMUONLocalTrigger.h" |
30178c30 | 24 | #include "AliMUONRawCluster.h" |
554b38a6 | 25 | #include "AliMUONTrack.h" |
e9bef706 | 26 | #include "AliMUONTriggerCircuit.h" |
a202c2d2 | 27 | #include "AliMUONVClusterStore.h" |
e9bef706 | 28 | #include "AliMUONVDigitStore.h" |
a202c2d2 | 29 | #include "AliMUONVTrackStore.h" |
e9bef706 | 30 | #include "AliMUONVTriggerStore.h" |
a202c2d2 | 31 | #include "AliMUONVTriggerTrackStore.h" |
e9bef706 | 32 | |
33 | #include "AliLoader.h" | |
34 | #include "AliLog.h" | |
a202c2d2 | 35 | #include "AliLog.h" |
e9bef706 | 36 | #include "AliRunLoader.h" |
37 | ||
38 | #include <TError.h> | |
39 | #include <TParticle.h> | |
40 | #include <Riostream.h> | |
41 | #include <TFile.h> | |
a202c2d2 | 42 | #include <TList.h> |
e9bef706 | 43 | #include <TNtuple.h> |
44 | #include <TSystem.h> | |
6d149c9e | 45 | |
3d1463c8 | 46 | //----------------------------------------------------------------------------- |
85fec35d | 47 | /// \class AliMUONDataInterface |
48 | /// | |
a202c2d2 | 49 | /// An easy to use interface to the MUON data data stored in |
50 | /// TreeS, TreeD, TreeR and TreeT. | |
51 | /// | |
52 | /// For MC related information (i.e. TreeH, TreeK, TreeTR), see | |
53 | /// AliMUONMCDataInterface. | |
54 | /// | |
85fec35d | 55 | /// |
56 | /// This interface in not necessarily the fastest way to fetch the data but | |
57 | /// it is the easiest. | |
85fec35d | 58 | /// |
a202c2d2 | 59 | /// \author Laurent Aphecetche, Subatech |
3d1463c8 | 60 | //----------------------------------------------------------------------------- |
13985652 | 61 | |
62 | /// \cond CLASSIMP | |
63 | ClassImp(AliMUONDataInterface) | |
64 | /// \endcond | |
48b32e42 | 65 | |
e9bef706 | 66 | //AliLoader* fLoader; //!< Tree accessor |
67 | //AliMUONVDigitStore* fDigitStore; //!< current digit store (owner) | |
68 | //AliMUONVTriggerStore* fTriggerStore; //!< current trigger store (owner) | |
69 | //AliMUONVClusterStore* fClusterStore; //!< current cluster store (owner) | |
70 | //AliMUONVTrackStore* fTrackStore; //!< current track store (owner) | |
71 | //AliMUONVTriggerTrackStore* fTriggerTrackStore; //!< current trigger track store (owner) | |
72 | //Int_t fCurrentEvent; //!< Current event we've read in | |
73 | //Bool_t fIsValid; //!< whether we were initialized properly or not | |
74 | ||
75 | Int_t AliMUONDataInterface::fgInstanceCounter(0); | |
76 | ||
a202c2d2 | 77 | //______________________________________________________________________________ |
78 | AliMUONDataInterface::AliMUONDataInterface(const char* filename) | |
e9bef706 | 79 | : TObject(), |
80 | fLoader(0x0), | |
81 | fDigitStore(0x0), | |
82 | fTriggerStore(0x0), | |
83 | fClusterStore(0x0), | |
84 | fTrackStore(0x0), | |
85 | fTriggerTrackStore(0x0), | |
86 | fCurrentEvent(-1), | |
87 | fIsValid(kFALSE) | |
48b32e42 | 88 | { |
a202c2d2 | 89 | /// ctor |
90 | /// @param filename should be the full path to a valid galice.root file | |
91 | ||
e9bef706 | 92 | ++fgInstanceCounter; |
93 | ||
94 | Open(filename); | |
925e6570 | 95 | } |
48b32e42 | 96 | |
a202c2d2 | 97 | //______________________________________________________________________________ |
48b32e42 | 98 | AliMUONDataInterface::~AliMUONDataInterface() |
99 | { | |
a202c2d2 | 100 | /// dtor |
e9bef706 | 101 | if ( fLoader ) |
102 | { | |
103 | delete fLoader->GetRunLoader(); | |
104 | } | |
105 | --fgInstanceCounter; | |
a202c2d2 | 106 | } |
48b32e42 | 107 | |
a202c2d2 | 108 | //______________________________________________________________________________ |
109 | AliMUONVClusterStore* | |
e9bef706 | 110 | AliMUONDataInterface::ClusterStore(Int_t event) |
a202c2d2 | 111 | { |
e9bef706 | 112 | /// Return clusterStore for a given event. |
113 | /// Return 0x0 if event not found. | |
114 | /// Returned pointer should not be deleted | |
115 | ||
116 | if ( LoadEvent(event) ) return 0x0; | |
117 | ||
118 | fLoader->LoadRecPoints(); | |
119 | ||
120 | TTree* treeR = fLoader->TreeR(); | |
121 | ||
122 | if (!treeR) | |
123 | { | |
124 | AliError("Could not get treeR"); | |
125 | return 0x0; | |
126 | } | |
127 | ||
128 | if (!fClusterStore) | |
129 | { | |
130 | fClusterStore = AliMUONVClusterStore::Create(*treeR); | |
131 | } | |
132 | ||
133 | if ( fClusterStore ) | |
134 | { | |
135 | fClusterStore->Clear(); | |
136 | fClusterStore->Connect(*treeR); | |
137 | treeR->GetEvent(0); | |
138 | } | |
139 | ||
140 | fLoader->UnloadRecPoints(); | |
141 | ||
142 | return fClusterStore; | |
143 | } | |
3455463a | 144 | |
e9bef706 | 145 | //______________________________________________________________________________ |
146 | AliMUONVDigitStore* | |
147 | AliMUONDataInterface::DigitStore(Int_t event) | |
148 | { | |
149 | /// Return digitStore for a given event. | |
150 | /// Return 0x0 if event not found. | |
151 | /// Returned pointer should not be deleted | |
152 | ||
153 | if ( LoadEvent(event) ) return 0x0; | |
154 | ||
155 | fLoader->LoadDigits(); | |
156 | ||
157 | TTree* treeD = fLoader->TreeD(); | |
158 | ||
159 | if (!treeD) | |
160 | { | |
161 | AliError("Could not get treeD"); | |
162 | return 0x0; | |
163 | } | |
164 | ||
165 | if (!fDigitStore) | |
166 | { | |
167 | fDigitStore = AliMUONVDigitStore::Create(*treeD); | |
168 | } | |
169 | ||
170 | if ( fDigitStore ) | |
171 | { | |
172 | fDigitStore->Clear(); | |
173 | fDigitStore->Connect(*treeD); | |
174 | treeD->GetEvent(0); | |
175 | } | |
176 | ||
177 | fLoader->UnloadDigits(); | |
178 | ||
179 | return fDigitStore; | |
925e6570 | 180 | } |
48b32e42 | 181 | |
a202c2d2 | 182 | //______________________________________________________________________________ |
183 | void | |
e9bef706 | 184 | AliMUONDataInterface::DumpDigits(Int_t event, Bool_t sorted) |
48b32e42 | 185 | { |
e9bef706 | 186 | /// Dump the digits for a given event, sorted if so required |
187 | DigitStore(event); | |
188 | if ( fDigitStore ) | |
189 | { | |
190 | if ( sorted ) | |
191 | { | |
192 | DumpSorted(*fDigitStore); | |
193 | } | |
194 | else | |
195 | { | |
196 | fDigitStore->Print(); | |
197 | } | |
198 | } | |
925e6570 | 199 | } |
48b32e42 | 200 | |
a202c2d2 | 201 | //______________________________________________________________________________ |
e9bef706 | 202 | void |
203 | AliMUONDataInterface::DumpRecPoints(Int_t event, Bool_t sorted) | |
6d149c9e | 204 | { |
e9bef706 | 205 | /// Dump the recpoints for a given event, sorted if so required |
206 | ClusterStore(event); | |
207 | if ( fClusterStore ) | |
208 | { | |
209 | if ( sorted ) | |
210 | { | |
211 | DumpSorted(*fClusterStore); | |
212 | } | |
213 | else | |
214 | { | |
215 | fClusterStore->Print(); | |
216 | } | |
217 | } | |
6d149c9e | 218 | } |
219 | ||
e9bef706 | 220 | //_____________________________________________________________________________ |
221 | void | |
222 | AliMUONDataInterface::DumpSorted(const AliMUONVStore& store) const | |
6d149c9e | 223 | { |
e9bef706 | 224 | /// Dump the given store, in sorted order |
a202c2d2 | 225 | |
e9bef706 | 226 | TIter next(store.CreateIterator()); |
a202c2d2 | 227 | TObject* object; |
e9bef706 | 228 | TList list; |
229 | list.SetOwner(kFALSE); | |
a202c2d2 | 230 | |
e9bef706 | 231 | while ( ( object = next() ) ) |
a202c2d2 | 232 | { |
e9bef706 | 233 | list.Add(object); |
a202c2d2 | 234 | } |
235 | ||
e9bef706 | 236 | list.Sort(); |
237 | ||
238 | list.Print(); | |
a202c2d2 | 239 | } |
240 | ||
241 | //______________________________________________________________________________ | |
242 | void | |
e9bef706 | 243 | AliMUONDataInterface::DumpTracks(Int_t event, Bool_t sorted) |
a202c2d2 | 244 | { |
e9bef706 | 245 | /// Dump tracks for a given event, sorted if requested |
246 | ||
247 | TrackStore(event); | |
248 | ||
249 | if ( fTrackStore ) | |
a202c2d2 | 250 | { |
e9bef706 | 251 | if ( sorted ) |
252 | { | |
253 | DumpSorted(*fTrackStore); | |
254 | } | |
255 | else | |
256 | { | |
257 | fTrackStore->Print(); | |
258 | } | |
a202c2d2 | 259 | } |
e9bef706 | 260 | } |
261 | ||
262 | //______________________________________________________________________________ | |
263 | void | |
264 | AliMUONDataInterface::DumpTriggerTracks(Int_t event, Bool_t sorted) | |
265 | { | |
266 | /// Dump trigger tracks for a given event, sorted if requested | |
267 | ||
268 | TriggerTrackStore(event); | |
a202c2d2 | 269 | |
e9bef706 | 270 | if ( fTriggerTrackStore ) |
a202c2d2 | 271 | { |
e9bef706 | 272 | if ( sorted ) |
273 | { | |
274 | DumpSorted(*fTriggerTrackStore); | |
275 | } | |
276 | else | |
a202c2d2 | 277 | { |
e9bef706 | 278 | fTriggerTrackStore->Print(); |
a202c2d2 | 279 | } |
e9bef706 | 280 | } |
281 | } | |
6d149c9e | 282 | |
e9bef706 | 283 | //_____________________________________________________________________________ |
284 | void | |
285 | AliMUONDataInterface::DumpTrigger(Int_t event, const char* treeLetter) | |
286 | { | |
287 | /// Dump trigger for a given event from a given tree (if event>=0) | |
288 | /// or loop over all events and build a trigger ntuple if event<0 | |
289 | /// treeLetter can be R or D to tell from which tree to read the information | |
a202c2d2 | 290 | |
e9bef706 | 291 | if ( event < 0 ) |
292 | { | |
293 | NtupleTrigger(treeLetter); | |
a202c2d2 | 294 | } |
295 | else | |
296 | { | |
e9bef706 | 297 | TriggerStore(event,treeLetter); |
a202c2d2 | 298 | |
e9bef706 | 299 | if ( fTriggerStore ) |
300 | { | |
301 | fTriggerStore->Print(); | |
302 | } | |
303 | } | |
a202c2d2 | 304 | } |
6d149c9e | 305 | |
e9bef706 | 306 | //_____________________________________________________________________________ |
a202c2d2 | 307 | void |
e9bef706 | 308 | AliMUONDataInterface::NtupleTrigger(const char* treeLetter) |
48b32e42 | 309 | { |
e9bef706 | 310 | //// Loop over events to build trigger ntuples |
311 | /// | |
312 | ||
313 | TString sTreeLetter(treeLetter); | |
314 | sTreeLetter.ToUpper(); | |
315 | ||
316 | if ( sTreeLetter != "R" && sTreeLetter != "D" ) | |
317 | { | |
318 | AliError(Form("Cannot handle tree%s. Use D or R",treeLetter)); | |
319 | return; | |
320 | } | |
321 | ||
322 | // book ntuples | |
323 | TNtuple tupleGlo("TgtupleGlo","Global Trigger Ntuple", | |
324 | "ev:slpt:shpt:uplpt:uphpt:lplpt:lplpt"); | |
325 | TNtuple tupleLoc("TgtupleLoc","Local Trigger Ntuple", | |
326 | "ev:LoCircuit:LoStripX:LoDev:StripY:LoLpt:LoHpt:y11:y21:x11"); | |
327 | ||
328 | // initialize counters | |
329 | Int_t sLowpt=0; | |
330 | Int_t sHighpt=0; | |
331 | Int_t uSLowpt=0; | |
332 | Int_t uSHighpt=0; | |
333 | Int_t lSLowpt=0; | |
334 | Int_t lSHighpt=0; | |
335 | ||
d3acfadf | 336 | AliMUONGeometryTransformer transformer; |
ef4cb4f1 | 337 | transformer.LoadGeometryData(Form("%s/geometry.root", |
e9bef706 | 338 | gSystem->DirName(fLoader->GetRunLoader()->GetFileName()))); |
339 | ||
340 | AliMUONTriggerCircuit triggerCircuit(&transformer); | |
341 | ||
342 | // select output file name from selected Tree | |
343 | Char_t fileNameOut[30]; | |
344 | if (sTreeLetter == "D") | |
345 | { | |
346 | AliInfo(Form("reading from Digits\n")); | |
347 | sprintf(fileNameOut,"TriggerCheckFromDigits.root"); | |
348 | } | |
349 | else if (sTreeLetter == "R") | |
350 | { | |
351 | AliInfo(Form("reading from RecPoints\n")); | |
352 | sprintf(fileNameOut,"TriggerCheckFromRP.root"); | |
353 | } | |
354 | ||
355 | // loop on events | |
356 | Int_t nevents = NumberOfEvents(); | |
357 | ||
358 | for (Int_t ievent=0; ievent<nevents; ++ievent) | |
359 | { | |
360 | if (ievent%100==0) AliInfo(Form("Processing event %d\n",ievent)); | |
361 | ||
362 | AliMUONVTriggerStore* triggerStore = TriggerStore(ievent); | |
363 | ||
364 | if (!triggerStore) | |
365 | { | |
366 | AliError(Form("Could not read %s from tree%s","Trigger",treeLetter)); | |
367 | return; | |
368 | } | |
369 | ||
370 | // get global trigger info | |
371 | AliMUONGlobalTrigger* gloTrg = triggerStore->Global(); | |
372 | sLowpt+=gloTrg->SingleLpt(); | |
373 | sHighpt+=gloTrg->SingleHpt(); | |
374 | uSLowpt+=gloTrg->PairUnlikeLpt(); | |
375 | uSHighpt+=gloTrg->PairUnlikeHpt(); | |
376 | lSLowpt+=gloTrg->PairLikeLpt(); | |
377 | lSHighpt+=gloTrg->PairLikeHpt(); | |
378 | ||
379 | // loop on local triggers | |
380 | TIter next(triggerStore->CreateIterator()); | |
381 | AliMUONLocalTrigger* locTrg(0x0); | |
382 | while ( ( locTrg = static_cast<AliMUONLocalTrigger*>(next()) ) ) | |
383 | { | |
384 | Bool_t xTrig=kFALSE; | |
385 | Bool_t yTrig=kFALSE; | |
386 | ||
387 | if ( locTrg->LoSdev()==1 && locTrg->LoDev()==0 && | |
388 | locTrg->LoStripX()==0) xTrig=kFALSE; // no trigger in X | |
389 | else xTrig=kTRUE; // trigger in X | |
390 | if (locTrg->LoTrigY()==1 && | |
391 | locTrg->LoStripY()==15 ) yTrig = kFALSE; // no trigger in Y | |
392 | else yTrig = kTRUE; // trigger in Y | |
393 | ||
394 | if (xTrig && yTrig) | |
395 | { // fill ntuple if trigger in X and Y | |
396 | tupleLoc.Fill(ievent,locTrg->LoCircuit(), | |
397 | locTrg->LoStripX(), | |
398 | locTrg->LoDev(), | |
399 | locTrg->LoStripY(), | |
400 | locTrg->LoLpt(), | |
401 | locTrg->LoHpt(), | |
402 | triggerCircuit.GetY11Pos(locTrg->LoCircuit(),locTrg->LoStripX()), | |
403 | triggerCircuit.GetY21Pos(locTrg->LoCircuit(),locTrg->LoStripX()+locTrg->LoDev()+1), | |
404 | triggerCircuit.GetX11Pos(locTrg->LoCircuit(),locTrg->LoStripY())); | |
405 | } | |
406 | tupleGlo.Fill(ievent,gloTrg->SingleLpt(),gloTrg->SingleHpt(), | |
407 | gloTrg->PairUnlikeLpt(),gloTrg->PairUnlikeHpt(), | |
408 | gloTrg->PairLikeLpt(),gloTrg->PairLikeHpt()); | |
409 | } // end of loop on local triggers | |
410 | } // end of loop on events | |
411 | ||
412 | // print info and store ntuples | |
413 | printf("\n"); | |
414 | printf("=============================================\n"); | |
415 | printf("================ SUMMARY ==================\n"); | |
416 | printf("\n"); | |
417 | printf("Total number of events processed %d \n",nevents); | |
418 | printf("\n"); | |
419 | printf(" Global Trigger output Low pt High pt\n"); | |
420 | printf(" number of Single :\t"); | |
421 | printf("%i\t%i\t",sLowpt,sHighpt); | |
422 | printf("\n"); | |
423 | printf(" number of UnlikeSign pair :\t"); | |
424 | printf("%i\t%i\t",uSLowpt,uSHighpt); | |
425 | printf("\n"); | |
426 | printf(" number of LikeSign pair :\t"); | |
427 | printf("%i\t%i\t",lSLowpt,lSHighpt); | |
428 | printf("\n"); | |
429 | printf("=============================================\n"); | |
430 | fflush(stdout); | |
431 | ||
432 | TFile myFile(fileNameOut, "RECREATE"); | |
433 | tupleGlo.Write(); | |
434 | tupleLoc.Write(); | |
435 | myFile.Close(); | |
925e6570 | 436 | } |
48b32e42 | 437 | |
a202c2d2 | 438 | //______________________________________________________________________________ |
439 | Bool_t | |
440 | AliMUONDataInterface::IsValid() const | |
441 | { | |
442 | /// Whether we were properly initialized from a valid galice.root file | |
e9bef706 | 443 | return fIsValid; |
a202c2d2 | 444 | } |
48b32e42 | 445 | |
e9bef706 | 446 | //_____________________________________________________________________________ |
a202c2d2 | 447 | Int_t |
e9bef706 | 448 | AliMUONDataInterface::LoadEvent(Int_t event) |
48b32e42 | 449 | { |
e9bef706 | 450 | /// Load event if different from the current one. |
451 | if ( event != fCurrentEvent ) | |
452 | { | |
453 | fCurrentEvent = event; | |
454 | AliDebug(1,Form("Loading event %d using runLoader %p",event,fLoader->GetRunLoader())); | |
455 | if ( event < NumberOfEvents() ) | |
456 | { | |
457 | return fLoader->GetRunLoader()->GetEvent(event); | |
458 | } | |
459 | else | |
460 | { | |
461 | return 1; | |
462 | } | |
463 | } | |
464 | return 0; | |
925e6570 | 465 | } |
48b32e42 | 466 | |
a202c2d2 | 467 | //______________________________________________________________________________ |
e9bef706 | 468 | Int_t |
469 | AliMUONDataInterface::NumberOfEvents() const | |
a202c2d2 | 470 | { |
e9bef706 | 471 | /// Number of events in the current galice.root file we're attached to |
472 | if (!IsValid()) return 0; | |
473 | return fLoader->GetRunLoader()->GetNumberOfEvents(); | |
a202c2d2 | 474 | } |
48b32e42 | 475 | |
e9bef706 | 476 | //_____________________________________________________________________________ |
a202c2d2 | 477 | void |
e9bef706 | 478 | AliMUONDataInterface::Open(const char* filename) |
48b32e42 | 479 | { |
e9bef706 | 480 | /// Connect to a given galice.root file |
481 | ||
482 | delete fDigitStore; | |
483 | fDigitStore=0x0; | |
484 | delete fTriggerStore; | |
485 | fTriggerStore=0x0; | |
486 | delete fClusterStore; | |
487 | fClusterStore=0x0; | |
488 | delete fTrackStore; | |
489 | fTrackStore=0x0; | |
490 | delete fTriggerTrackStore; | |
491 | fTriggerTrackStore=0x0; | |
492 | ||
493 | fCurrentEvent=-1; | |
494 | ||
495 | if ( fLoader ) | |
496 | { | |
497 | delete fLoader->GetRunLoader(); | |
498 | } | |
499 | ||
500 | fLoader = 0x0; | |
501 | ||
502 | fIsValid = kTRUE; | |
503 | ||
504 | TString foldername(Form("%s-%d",ClassName(),fgInstanceCounter)); | |
505 | ||
506 | while (AliRunLoader::GetRunLoader(foldername)) | |
507 | { | |
508 | delete AliRunLoader::GetRunLoader(foldername); | |
509 | } | |
510 | ||
511 | AliRunLoader* runLoader = AliRunLoader::Open(filename,foldername); | |
512 | if (!runLoader) | |
513 | { | |
514 | AliError(Form("Cannot open file %s",filename)); | |
515 | fIsValid = kFALSE; | |
516 | } | |
517 | fLoader = runLoader->GetDetectorLoader("MUON"); | |
518 | if (!fLoader) | |
519 | { | |
520 | AliError("Cannot get AliMUONLoader"); | |
521 | fIsValid = kFALSE; | |
522 | } | |
523 | ||
524 | if (!IsValid()) | |
525 | { | |
526 | AliError(Form("Could not access %s filename. Object is unuseable",filename)); | |
527 | } | |
925e6570 | 528 | } |
48b32e42 | 529 | |
a202c2d2 | 530 | //______________________________________________________________________________ |
531 | AliMUONVTrackStore* | |
e9bef706 | 532 | AliMUONDataInterface::TrackStore(Int_t event) |
48b32e42 | 533 | { |
e9bef706 | 534 | /// Return the trackStore for a given event. |
535 | /// Return 0x0 if event not found. | |
536 | /// Returned pointer should not be deleted | |
537 | ||
538 | if ( LoadEvent(event) ) return 0x0; | |
539 | ||
540 | fLoader->LoadTracks(); | |
541 | ||
542 | TTree* treeT = fLoader->TreeT(); | |
543 | ||
544 | if (!treeT) | |
545 | { | |
546 | AliError("Could not get treeT"); | |
547 | return 0x0; | |
548 | } | |
549 | ||
550 | if (!fTrackStore) | |
551 | { | |
552 | fTrackStore = AliMUONVTrackStore::Create(*treeT); | |
553 | } | |
554 | ||
555 | if ( fTrackStore ) | |
556 | { | |
557 | fTrackStore->Clear(); | |
558 | fTrackStore->Connect(*treeT); | |
559 | treeT->GetEvent(0); | |
560 | } | |
561 | ||
562 | fLoader->UnloadTracks(); | |
563 | ||
564 | return fTrackStore; | |
925e6570 | 565 | } |
48b32e42 | 566 | |
a202c2d2 | 567 | //______________________________________________________________________________ |
568 | AliMUONVTriggerTrackStore* | |
e9bef706 | 569 | AliMUONDataInterface::TriggerTrackStore(Int_t event) |
a202c2d2 | 570 | { |
e9bef706 | 571 | /// Return the triggerTrackStore for a given event. |
572 | /// Return 0x0 if event not found. | |
573 | /// Returned pointer should not be deleted | |
574 | ||
575 | if ( LoadEvent(event) ) return 0x0; | |
576 | ||
577 | fLoader->LoadTracks(); | |
578 | ||
579 | TTree* treeT = fLoader->TreeT(); | |
580 | ||
581 | if (!treeT) | |
582 | { | |
583 | AliError("Could not get treeT"); | |
584 | return 0x0; | |
585 | } | |
586 | ||
587 | if (!fTriggerTrackStore) | |
588 | { | |
589 | fTriggerTrackStore = AliMUONVTriggerTrackStore::Create(*treeT); | |
590 | } | |
591 | ||
592 | if ( fTriggerTrackStore ) | |
593 | { | |
594 | fTriggerTrackStore->Clear(); | |
595 | fTriggerTrackStore->Connect(*treeT); | |
596 | treeT->GetEvent(0); | |
597 | } | |
598 | ||
599 | fLoader->UnloadTracks(); | |
600 | ||
601 | return fTriggerTrackStore; | |
a202c2d2 | 602 | } |
48b32e42 | 603 | |
e9bef706 | 604 | //_____________________________________________________________________________ |
605 | AliMUONVTriggerStore* | |
606 | AliMUONDataInterface::TriggerStore(Int_t event, const char* treeLetter) | |
48b32e42 | 607 | { |
e9bef706 | 608 | /// Return the triggerStore for a given event. |
609 | /// Return 0x0 if event not found. | |
610 | /// Returned pointer should not be deleted | |
611 | /// treeLetter can be R or D to tell from which tree to read the information | |
612 | ||
613 | if ( LoadEvent(event) ) return 0x0; | |
614 | ||
615 | TTree* tree(0x0); | |
616 | ||
617 | TString stree(treeLetter); | |
618 | stree.ToUpper(); | |
619 | ||
620 | if ( stree == "D" ) | |
621 | { | |
622 | fLoader->LoadDigits(); | |
623 | tree = fLoader->TreeD(); | |
624 | } | |
625 | else if ( stree == "R" ) | |
626 | { | |
627 | fLoader->LoadRecPoints(); | |
628 | tree = fLoader->TreeR(); | |
629 | } | |
630 | ||
631 | if ( !tree ) | |
632 | { | |
633 | AliError(Form("Could not get tree%s",treeLetter)); | |
634 | return 0x0; | |
635 | } | |
636 | ||
637 | if (!fTriggerStore) | |
638 | { | |
639 | fTriggerStore = AliMUONVTriggerStore::Create(*tree); | |
640 | } | |
641 | ||
642 | if ( fTriggerStore ) | |
643 | { | |
644 | fTriggerStore->Clear(); | |
645 | fTriggerStore->Connect(*tree); | |
646 | tree->GetEvent(0); | |
647 | } | |
648 | ||
649 | if ( stree == "D" ) | |
650 | { | |
651 | fLoader->UnloadDigits(); | |
652 | } | |
653 | else if ( stree == "R" ) | |
654 | { | |
655 | fLoader->UnloadRecPoints(); | |
656 | } | |
657 | ||
658 | return fTriggerStore; | |
925e6570 | 659 | } |
48b32e42 | 660 | |
a202c2d2 | 661 | //______________________________________________________________________________ |
662 | //______________________________________________________________________________ | |
663 | //______________________________________________________________________________ | |
664 | //______________________________________________________________________________ | |
48b32e42 | 665 | |
a202c2d2 | 666 | void AliMUONDataInterface::Reset() |
48b32e42 | 667 | { |
a202c2d2 | 668 | /// \deprecated Method is going to be removed |
669 | ||
670 | AliFatal("Deprecated"); | |
925e6570 | 671 | } |
48b32e42 | 672 | |
a202c2d2 | 673 | Bool_t AliMUONDataInterface::UseCurrentRunLoader() |
554b38a6 | 674 | { |
a202c2d2 | 675 | /// \deprecated Method is going to be removed |
676 | ||
677 | AliFatal("Deprecated"); | |
678 | return kFALSE; | |
554b38a6 | 679 | } |
680 | ||
a202c2d2 | 681 | Int_t AliMUONDataInterface::NumberOfEvents(TString , TString ) |
48b32e42 | 682 | { |
a202c2d2 | 683 | /// \deprecated Method is going to be removed |
48b32e42 | 684 | |
a202c2d2 | 685 | AliFatal("Deprecated"); |
686 | return 0; | |
925e6570 | 687 | } |
48b32e42 | 688 | |
689 | ||
a202c2d2 | 690 | Int_t AliMUONDataInterface::NumberOfParticles(TString , TString , Int_t ) |
48b32e42 | 691 | { |
a202c2d2 | 692 | /// \deprecated Method is going to be removed |
48b32e42 | 693 | |
a202c2d2 | 694 | AliFatal("Deprecated"); |
695 | return 0; | |
925e6570 | 696 | } |
48b32e42 | 697 | |
698 | ||
699 | TParticle* AliMUONDataInterface::Particle( | |
a202c2d2 | 700 | TString , TString , Int_t , Int_t |
48b32e42 | 701 | ) |
702 | { | |
a202c2d2 | 703 | /// \deprecated Method is going to be removed |
704 | ||
705 | AliFatal("Deprecated"); | |
706 | return 0; | |
925e6570 | 707 | } |
48b32e42 | 708 | |
709 | ||
a202c2d2 | 710 | Int_t AliMUONDataInterface::NumberOfTracks(TString , TString , Int_t ) |
48b32e42 | 711 | { |
a202c2d2 | 712 | /// \deprecated Method is going to be removed |
48b32e42 | 713 | |
a202c2d2 | 714 | AliFatal("Deprecated"); |
715 | return 0; | |
925e6570 | 716 | } |
48b32e42 | 717 | |
718 | ||
719 | Int_t AliMUONDataInterface::NumberOfHits( | |
a202c2d2 | 720 | TString , TString , Int_t , Int_t |
48b32e42 | 721 | ) |
722 | { | |
a202c2d2 | 723 | /// \deprecated Method is going to be removed |
724 | ||
725 | AliFatal("Deprecated"); | |
726 | return 0; | |
925e6570 | 727 | } |
48b32e42 | 728 | |
729 | ||
730 | AliMUONHit* AliMUONDataInterface::Hit( | |
a202c2d2 | 731 | TString , TString , Int_t , |
732 | Int_t , Int_t | |
48b32e42 | 733 | ) |
734 | { | |
a202c2d2 | 735 | /// \deprecated Method is going to be removed |
736 | ||
737 | AliFatal("Deprecated"); | |
738 | return 0; | |
925e6570 | 739 | } |
48b32e42 | 740 | |
741 | ||
742 | Int_t AliMUONDataInterface::NumberOfSDigits( | |
a202c2d2 | 743 | TString , TString , Int_t , |
744 | Int_t , Int_t | |
48b32e42 | 745 | ) |
746 | { | |
a202c2d2 | 747 | /// \deprecated Method is going to be removed |
748 | ||
749 | AliFatal("Deprecated"); | |
750 | return 0; | |
925e6570 | 751 | } |
48b32e42 | 752 | |
753 | ||
754 | AliMUONDigit* AliMUONDataInterface::SDigit( | |
a202c2d2 | 755 | TString , TString , Int_t , |
756 | Int_t , Int_t , Int_t | |
48b32e42 | 757 | ) |
758 | { | |
a202c2d2 | 759 | /// \deprecated Method is going to be removed |
760 | ||
761 | AliFatal("Deprecated"); | |
762 | return 0; | |
925e6570 | 763 | } |
48b32e42 | 764 | |
765 | ||
766 | Int_t AliMUONDataInterface::NumberOfDigits( | |
a202c2d2 | 767 | TString , TString , Int_t , |
768 | Int_t , Int_t | |
48b32e42 | 769 | ) |
770 | { | |
a202c2d2 | 771 | /// \deprecated Method is going to be removed |
772 | ||
773 | AliFatal("Deprecated"); | |
774 | return 0; | |
925e6570 | 775 | } |
48b32e42 | 776 | |
777 | ||
778 | AliMUONDigit* AliMUONDataInterface::Digit( | |
a202c2d2 | 779 | TString , TString , Int_t , |
780 | Int_t , Int_t , Int_t | |
48b32e42 | 781 | ) |
782 | { | |
a202c2d2 | 783 | /// \deprecated Method is going to be removed |
784 | ||
785 | AliFatal("Deprecated"); | |
786 | return 0; | |
925e6570 | 787 | } |
48b32e42 | 788 | |
789 | ||
790 | Int_t AliMUONDataInterface::NumberOfRawClusters( | |
a202c2d2 | 791 | TString , TString , Int_t , Int_t |
48b32e42 | 792 | ) |
793 | { | |
a202c2d2 | 794 | /// \deprecated Method is going to be removed |
795 | ||
796 | AliFatal("Deprecated"); | |
797 | return 0; | |
925e6570 | 798 | } |
48b32e42 | 799 | |
800 | ||
801 | AliMUONRawCluster* AliMUONDataInterface::RawCluster( | |
a202c2d2 | 802 | TString , TString , Int_t , |
803 | Int_t , Int_t | |
48b32e42 | 804 | ) |
805 | { | |
a202c2d2 | 806 | /// \deprecated Method is going to be removed |
807 | ||
808 | AliFatal("Deprecated"); | |
809 | return 0; | |
925e6570 | 810 | } |
48b32e42 | 811 | |
812 | ||
a202c2d2 | 813 | Int_t AliMUONDataInterface::NumberOfLocalTriggers(TString , TString , Int_t ) |
48b32e42 | 814 | { |
a202c2d2 | 815 | /// \deprecated Method is going to be removed |
816 | ||
817 | AliFatal("Deprecated"); | |
818 | return 0; | |
925e6570 | 819 | } |
48b32e42 | 820 | |
821 | ||
822 | AliMUONLocalTrigger* AliMUONDataInterface::LocalTrigger( | |
a202c2d2 | 823 | TString , TString , Int_t , Int_t |
48b32e42 | 824 | ) |
825 | { | |
a202c2d2 | 826 | /// \deprecated Method is going to be removed |
827 | ||
828 | AliFatal("Deprecated"); | |
829 | return 0; | |
925e6570 | 830 | } |
48b32e42 | 831 | |
a202c2d2 | 832 | Bool_t AliMUONDataInterface::SetFile(TString , TString ) |
48b32e42 | 833 | { |
a202c2d2 | 834 | /// \deprecated Method is going to be removed |
48b32e42 | 835 | |
a202c2d2 | 836 | AliFatal("Deprecated"); |
837 | return 0; | |
925e6570 | 838 | } |
48b32e42 | 839 | |
840 | ||
a202c2d2 | 841 | Bool_t AliMUONDataInterface::GetEvent(Int_t ) |
48b32e42 | 842 | { |
a202c2d2 | 843 | /// \deprecated Method is going to be removed |
48b32e42 | 844 | |
a202c2d2 | 845 | AliFatal("Deprecated"); |
846 | return 0; | |
925e6570 | 847 | } |
48b32e42 | 848 | |
48b32e42 | 849 | Int_t AliMUONDataInterface::NumberOfParticles() |
850 | { | |
a202c2d2 | 851 | /// \deprecated Method is going to be removed |
852 | ||
853 | AliFatal("Deprecated"); | |
854 | return 0; | |
925e6570 | 855 | } |
48b32e42 | 856 | |
857 | ||
a202c2d2 | 858 | TParticle* AliMUONDataInterface::Particle(Int_t ) |
48b32e42 | 859 | { |
a202c2d2 | 860 | /// \deprecated Method is going to be removed |
861 | ||
862 | AliFatal("Deprecated"); | |
863 | return 0; | |
925e6570 | 864 | } |
48b32e42 | 865 | |
866 | ||
867 | Int_t AliMUONDataInterface::NumberOfTracks() | |
868 | { | |
a202c2d2 | 869 | /// \deprecated Method is going to be removed |
870 | ||
871 | AliFatal("Deprecated"); | |
872 | return 0; | |
925e6570 | 873 | } |
48b32e42 | 874 | |
875 | ||
a202c2d2 | 876 | Int_t AliMUONDataInterface::NumberOfHits(Int_t ) |
48b32e42 | 877 | { |
a202c2d2 | 878 | /// \deprecated Method is going to be removed |
879 | ||
880 | AliFatal("Deprecated"); | |
881 | return 0; | |
925e6570 | 882 | } |
48b32e42 | 883 | |
884 | ||
a202c2d2 | 885 | AliMUONHit* |
886 | AliMUONDataInterface::Hit(Int_t , Int_t ) | |
48b32e42 | 887 | { |
a202c2d2 | 888 | /// \deprecated Method is going to be removed |
889 | ||
890 | AliFatal("Deprecated"); | |
891 | return 0; | |
925e6570 | 892 | } |
48b32e42 | 893 | |
894 | ||
a202c2d2 | 895 | Int_t AliMUONDataInterface::NumberOfSDigits(Int_t , Int_t ) |
48b32e42 | 896 | { |
a202c2d2 | 897 | /// \deprecated Method is going to be removed |
898 | ||
899 | AliFatal("Deprecated"); | |
900 | return 0; | |
925e6570 | 901 | } |
48b32e42 | 902 | |
903 | ||
a202c2d2 | 904 | AliMUONDigit* AliMUONDataInterface::SDigit(Int_t , Int_t , Int_t ) |
48b32e42 | 905 | { |
a202c2d2 | 906 | /// \deprecated Method is going to be removed |
907 | ||
908 | AliFatal("Deprecated"); | |
909 | return 0; | |
910 | ||
925e6570 | 911 | } |
48b32e42 | 912 | |
913 | ||
a202c2d2 | 914 | Int_t AliMUONDataInterface::NumberOfDigits(Int_t , Int_t ) |
48b32e42 | 915 | { |
a202c2d2 | 916 | /// \deprecated Method is going to be removed |
917 | ||
918 | AliFatal("Deprecated"); | |
919 | return 0; | |
920 | ||
925e6570 | 921 | } |
48b32e42 | 922 | |
923 | ||
a202c2d2 | 924 | AliMUONDigit* AliMUONDataInterface::Digit(Int_t , Int_t , Int_t ) |
48b32e42 | 925 | { |
a202c2d2 | 926 | /// \deprecated Method is going to be removed |
927 | ||
928 | AliFatal("Deprecated"); | |
929 | return 0; | |
925e6570 | 930 | } |
48b32e42 | 931 | |
932 | ||
a202c2d2 | 933 | Int_t AliMUONDataInterface::NumberOfRawClusters(Int_t ) |
48b32e42 | 934 | { |
a202c2d2 | 935 | /// \deprecated Method is going to be removed |
936 | ||
937 | AliFatal("Deprecated"); | |
938 | return 0; | |
925e6570 | 939 | } |
48b32e42 | 940 | |
941 | ||
a202c2d2 | 942 | AliMUONRawCluster* AliMUONDataInterface::RawCluster(Int_t , Int_t ) |
48b32e42 | 943 | { |
a202c2d2 | 944 | /// \deprecated Method is going to be removed |
945 | ||
946 | AliFatal("Deprecated"); | |
947 | return 0; | |
925e6570 | 948 | } |
48b32e42 | 949 | |
950 | ||
951 | Int_t AliMUONDataInterface::NumberOfLocalTriggers() | |
952 | { | |
a202c2d2 | 953 | /// \deprecated Method is going to be removed |
954 | ||
955 | AliFatal("Deprecated"); | |
956 | return 0; | |
925e6570 | 957 | } |
48b32e42 | 958 | |
959 | ||
a202c2d2 | 960 | AliMUONLocalTrigger* AliMUONDataInterface::LocalTrigger(Int_t ) |
48b32e42 | 961 | { |
a202c2d2 | 962 | /// \deprecated Method is going to be removed |
963 | ||
964 | AliFatal("Deprecated"); | |
965 | return 0; | |
925e6570 | 966 | } |
554b38a6 | 967 | |
968 | Int_t AliMUONDataInterface::NumberOfGlobalTriggers() | |
969 | { | |
a202c2d2 | 970 | /// \deprecated Method is going to be removed |
971 | ||
972 | AliFatal("Deprecated"); | |
973 | return 0; | |
554b38a6 | 974 | } |
975 | ||
a202c2d2 | 976 | AliMUONGlobalTrigger* AliMUONDataInterface::GlobalTrigger(Int_t ) |
554b38a6 | 977 | { |
a202c2d2 | 978 | /// \deprecated Method is going to be removed |
979 | ||
980 | AliFatal("Deprecated"); | |
981 | return 0; | |
554b38a6 | 982 | } |
983 | ||
984 | Int_t AliMUONDataInterface::NumberOfRecTracks() | |
985 | { | |
a202c2d2 | 986 | /// \deprecated Method is going to be removed |
987 | ||
988 | AliFatal("Deprecated"); | |
989 | return 0; | |
554b38a6 | 990 | } |
991 | ||
a202c2d2 | 992 | AliMUONTrack* AliMUONDataInterface::RecTrack(Int_t ) |
554b38a6 | 993 | { |
a202c2d2 | 994 | /// \deprecated Method is going to be removed |
995 | ||
996 | AliFatal("Deprecated"); | |
997 | return 0; | |
554b38a6 | 998 | } |