1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 #include "AliMUONCheck.h"
20 #include "AliLoader.h"
22 #include "AliRunLoader.h"
23 #include "AliMUONData.h"
24 #include "AliMUONDataIterator.h"
25 #include "AliMUONDigit.h"
27 /// \class AliMUONCheck
28 /// \brief A helper class to dump data from AliRoot-generated root files.
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.
33 /// \author Laurent Aphecetche
36 ClassImp(AliMUONCheck)
39 //_____________________________________________________________________________
40 AliMUONCheck::AliMUONCheck(const char* galiceFile,
41 Int_t firstEvent, Int_t lastEvent)
43 fFileName(galiceFile),
44 fFirstEvent(firstEvent),
45 fLastEvent(lastEvent),
49 /// Standard constructor
51 fRunLoader = AliRunLoader::Open(fFileName.Data(),"MUONFolder","READ");
54 AliError(Form("Error opening %s file \n",fFileName.Data()));
58 AliLoader* loader = fRunLoader->GetLoader("MUONLoader");
61 fData = new AliMUONData(loader,"MUON","MUON");
65 AliError(Form("Could get MUONLoader"));
70 //_____________________________________________________________________________
71 AliMUONCheck::~AliMUONCheck()
78 //_____________________________________________________________________________
80 AliMUONCheck::DumpDigits(Option_t* opt) const
82 /// Dump the digits to screen
84 if ( !IsValid() ) return;
86 Int_t nevents = fRunLoader->GetNumberOfEvents();
87 Int_t endOfLoop = fLastEvent+1;
89 if ( fLastEvent == -1 ) endOfLoop = nevents;
91 for ( Int_t ievent = fFirstEvent; ievent < endOfLoop; ++ievent )
93 fRunLoader->GetEvent(ievent);
95 AliMUONDataIterator it(fData,"digit",AliMUONDataIterator::kTrackingChambers);
98 while ( ( digit = (AliMUONDigit*)it.Next() ) )