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 /// A helper class to dump data from AliRoot-generated root files.
29 /// Only implemented for digits so far, it is meant as a replacement
30 /// of the MUONCheck.C macro, or to be used by this macro to simplify it.
33 ClassImp(AliMUONCheck)
35 //_____________________________________________________________________________
36 AliMUONCheck::AliMUONCheck(const char* galiceFile,
37 Int_t firstEvent, Int_t lastEvent)
39 fFileName(galiceFile),
40 fFirstEvent(firstEvent),
41 fLastEvent(lastEvent),
47 fRunLoader = AliRunLoader::Open(fFileName.Data(),"MUONFolder","READ");
50 AliError(Form("Error opening %s file \n",fFileName.Data()));
54 AliLoader* loader = fRunLoader->GetLoader("MUONLoader");
57 fData = new AliMUONData(loader,"MUON","MUON");
61 AliError(Form("Could get MUONLoader"));
66 //_____________________________________________________________________________
67 AliMUONCheck::AliMUONCheck(const AliMUONCheck& rhs) : TObject(rhs)
70 AliFatal("Implement me if needed");
73 //_____________________________________________________________________________
75 AliMUONCheck::operator=(const AliMUONCheck&)
77 // assignement operator
78 AliFatal("Implement me if needed")
82 //_____________________________________________________________________________
83 AliMUONCheck::~AliMUONCheck()
89 //_____________________________________________________________________________
91 AliMUONCheck::DumpDigits(Option_t* opt) const
93 // Dump the digits to screen
94 if ( !IsValid() ) return;
96 Int_t nevents = fRunLoader->GetNumberOfEvents();
97 Int_t endOfLoop = fLastEvent+1;
99 if ( fLastEvent == -1 ) endOfLoop = nevents;
101 for ( Int_t ievent = fFirstEvent; ievent < endOfLoop; ++ievent )
103 fRunLoader->GetEvent(ievent);
105 AliMUONDataIterator it(fData,"digit",AliMUONDataIterator::kTrackingChambers);
108 while ( ( digit = (AliMUONDigit*)it.Next() ) )