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