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