end-of-line normalization
[u/mrichter/AliRoot.git] / PWG / muondep / AccEffTemplates / CheckESD.C
CommitLineData
a65a7e70 1Bool_t CheckESD(const char* esdFileName = "AliESDs.root")
2{
3//nb (commented)
4 //AliCDBManager *cdb = AliCDBManager::Instance();
5 //cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
6
7 // open the ESD file
8 TFile* esdFile = TFile::Open(esdFileName);
9 if (!esdFile || !esdFile->IsOpen()) {
10 Error("CheckESD", "opening ESD file %s failed", esdFileName);
11 return kFALSE;
12 }
13 AliESDEvent * esd = new AliESDEvent;
14 TTree* tree = (TTree*) esdFile->Get("esdTree");
15 if (!tree) {
16 Error("CheckESD", "no ESD tree found");
17 return kFALSE;
18 }
19 esd->ReadFromTree(tree);
20
21 // loop over events
22 for (Int_t iEvent = 0; iEvent < tree->GetEntries(); iEvent++) {
23
24 // get the event summary data
25 tree->GetEvent(iEvent);
26 if (!esd) {
27 Error("CheckESD", "no ESD object found for event %d", iEvent);
28 return kFALSE;
29 }
30
31 Int_t nTracks = esd->GetNumberOfMuonTracks();
32 for(Int_t iTracks = 0; iTracks < nTracks; iTracks++) {
33 AliESDMuonTrack* muonTrack = esd->GetMuonTrack(iTracks);
34 if (muonTrack->ContainTrackerData()) {
35 }
36 }
37
38 }
39
40 delete esd;
41 esdFile->Close();
42 delete esdFile;
43
44 // result of check
45 Info("CheckESD", "check of ESD was successfull");
46 return kTRUE;
47
48}
49