- TFile *pEsdFl=TFile::Open("AliESDs.root"); gEsdTr=(TTree*) pEsdFl->Get("esdTree"); gEsdTr->SetBranchAddress("ESD", &gEsd);
- pAll->cd(7); TButton *pBtn=new TButton("Next","ReadEvt()",0,0,0.2,0.1); pBtn->Draw();
- ReadEvt();
- }else{
- pAll->cd(7); TButton *pBtn=new TButton("Next","SimEvt()",0,0,0.2,0.1); pBtn->Draw();
- SimEvt();
- }
+ OpenCalib();
+ if(gSystem->IsFileInIncludePath("galice.root")){// tries to open session
+ if(gAlice) delete gAlice; //in case we execute this in aliroot delete default AliRun object
+ gAL=AliRunLoader::Open(); //try to open galice.root from current dir
+ gAL->LoadgAlice(); //take new AliRun object from galice.root
+ gHL=gAL->GetDetectorLoader("HMPID"); gH=(AliHMPID*)gAL->GetAliRun()->GetDetector("HMPID"); //get HMPID object from galice.root
+ gMaxEvt=gAL->GetNumberOfEvents()-1;
+ gHL->LoadHits(); gHL->LoadSDigits(); gHL->LoadDigits(); gHL->LoadRecPoints();
+
+ AliHMPIDTracker::SetFieldMap(gAL->GetAliRun()->Field(),kTRUE);
+
+ TFile *pEsdFl=TFile::Open("AliESDs.root"); gEsdTr=(TTree*) pEsdFl->Get("esdTree"); gEsdTr->SetBranchAddress("ESD", &gEsd);
+ pAll->cd(7); TButton *pBtn=new TButton("Next","ReadEvt()",0,0,0.2,0.1); pBtn->Draw();
+ TButton *pHitBtn=new TButton("Print hits","PrintHits()",0,0.2,0.3,0.3); pHitBtn->Draw();
+ TButton *pSdiBtn=new TButton("Print sdis","PrintSdis()",0,0.4,0.3,0.5); pSdiBtn->Draw();
+ TButton *pDigBtn=new TButton("Print digs","PrintDigs()",0,0.6,0.3,0.7); pDigBtn->Draw();
+ TButton *pCluBtn=new TButton("Print clus","PrintClus()",0,0.8,0.3,0.9); pCluBtn->Draw();
+ ReadEvt();
+ }
+ else if ( gSystem->IsFileInIncludePath(Form("cosmic%d.root",cosRun))){ //clm: Check if cosmic file is in the folder
+ gCosRun=cosRun;
+ pCosCh->Add(Form("cosmic%d.root",gCosRun)); //clm: Add cosmic file to chain
+ pCosCh->SetBranchAddress("Digs",&pCosDigAll); //clm: Set digit branch address
+ pCosCh->SetBranchAddress("Clus",&pCosCluAll); //clm: Set cluster branch address
+ gMaxEvt=pCosCh->GetEntries()-1; //clm: Get number of events from the cosmic chain
+ pAll->cd(7); TButton *pCosBtn=new TButton("Next Cosmic","ReadCosEvt()",0,0,0.3,0.1); pCosBtn->Draw(); //clm: define next button
+ ReadCosEvt(); //clm: Read first cosmic event
+ }
+ else{
+ pAll->cd(7); TButton *pBtn=new TButton("Next","SimEvt()",0,0,0.2,0.1); pBtn->Draw();
+ SimEvt();
+ }
+}
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void ReadCosEvt()
+{// Read curent cosmic event and display it assumes that session is alredy opened
+ if(gEvt>gMaxEvt) gEvt=0; if(gEvt<0) gEvt=gMaxEvt; //clm: set event limits
+ pCosCh->GetEntry(gEvt); //clm: read event from chain
+ DrawCosEvt(pCosDigAll,pCosCluAll); //clm: draw cosmic event
+ gEvt++;