]>
Commit | Line | Data |
---|---|---|
70b4a8d6 | 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$ | |
17 | ||
18 | #include "AliMUONCheck.h" | |
19 | ||
20 | #include "AliLoader.h" | |
21 | #include "AliLog.h" | |
22 | #include "AliRunLoader.h" | |
23 | #include "AliMUONData.h" | |
24 | #include "AliMUONDataIterator.h" | |
25 | #include "AliMUONDigit.h" | |
26 | ||
5398f946 | 27 | /// \class AliMUONCheck |
28 | /// \brief A helper class to dump data from AliRoot-generated root files. | |
70b4a8d6 | 29 | /// |
30 | /// Only implemented for digits so far, it is meant as a replacement | |
31 | /// of the MUONCheck.C macro, or to be used by this macro to simplify it. | |
32 | /// | |
5398f946 | 33 | /// \author Laurent Aphecetche |
70b4a8d6 | 34 | |
5398f946 | 35 | /// \cond CLASSIMP |
70b4a8d6 | 36 | ClassImp(AliMUONCheck) |
5398f946 | 37 | /// \endcond |
70b4a8d6 | 38 | |
39 | //_____________________________________________________________________________ | |
40 | AliMUONCheck::AliMUONCheck(const char* galiceFile, | |
41 | Int_t firstEvent, Int_t lastEvent) | |
42 | : TObject(), | |
43 | fFileName(galiceFile), | |
44 | fFirstEvent(firstEvent), | |
45 | fLastEvent(lastEvent), | |
46 | fRunLoader(0x0), | |
47 | fData(0x0) | |
48 | { | |
5398f946 | 49 | /// Standard constructor |
70b4a8d6 | 50 | |
51 | fRunLoader = AliRunLoader::Open(fFileName.Data(),"MUONFolder","READ"); | |
52 | if (!fRunLoader) | |
53 | { | |
54 | AliError(Form("Error opening %s file \n",fFileName.Data())); | |
55 | } | |
56 | else | |
57 | { | |
58 | AliLoader* loader = fRunLoader->GetLoader("MUONLoader"); | |
59 | if ( loader ) | |
60 | { | |
61 | fData = new AliMUONData(loader,"MUON","MUON"); | |
62 | } | |
63 | else | |
64 | { | |
65 | AliError(Form("Could get MUONLoader")); | |
66 | } | |
67 | } | |
68 | } | |
69 | ||
70b4a8d6 | 70 | //_____________________________________________________________________________ |
71 | AliMUONCheck::~AliMUONCheck() | |
72 | { | |
5398f946 | 73 | /// Destructor |
74 | ||
70b4a8d6 | 75 | delete fData; |
76 | } | |
77 | ||
78 | //_____________________________________________________________________________ | |
79 | void | |
80 | AliMUONCheck::DumpDigits(Option_t* opt) const | |
81 | { | |
5398f946 | 82 | /// Dump the digits to screen |
83 | ||
70b4a8d6 | 84 | if ( !IsValid() ) return; |
85 | ||
86 | Int_t nevents = fRunLoader->GetNumberOfEvents(); | |
87 | Int_t endOfLoop = fLastEvent+1; | |
88 | ||
89 | if ( fLastEvent == -1 ) endOfLoop = nevents; | |
90 | ||
91 | for ( Int_t ievent = fFirstEvent; ievent < endOfLoop; ++ievent ) | |
92 | { | |
93 | fRunLoader->GetEvent(ievent); | |
94 | ||
95 | AliMUONDataIterator it(fData,"digit",AliMUONDataIterator::kTrackingChambers); | |
96 | AliMUONDigit* digit; | |
97 | ||
98 | while ( ( digit = (AliMUONDigit*)it.Next() ) ) | |
99 | { | |
100 | digit->Print(opt); | |
101 | } | |
102 | } | |
103 | } |