]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONCheck.cxx
adding separate primary vertex and V0 finder components (Timur)
[u/mrichter/AliRoot.git] / MUON / AliMUONCheck.cxx
index 6d985c39726e342cf15c79bd976d3846f5a260de..531d46fb203570af9cda3584b7ecdec6781687e1 100644 (file)
 ClassImp(AliMUONCheck)
 /// \endcond
 
+const TString AliMUONCheck::fgkDefaultOutFileName = "output.txt"; //!< default output file name 
+
 AliMUONCheck::AliMUONCheck(const char* galiceFile, const char* esdFile,Int_t firstEvent, Int_t lastEvent,const char* outDir) 
 : TObject(),
 fFileName(galiceFile),
 fFileNameSim(),
 fesdFileName(esdFile),
 fkOutDir(outDir),
+fOutFileName(fgkDefaultOutFileName),
 fFirstEvent(firstEvent),
 fLastEvent(lastEvent)
 {
@@ -84,6 +87,7 @@ fFileName(galiceFile),
 fFileNameSim(galiceFileSim),
 fesdFileName(esdFile),
 fkOutDir(outDir),
+fOutFileName(fgkDefaultOutFileName),
 fFirstEvent(firstEvent),
 fLastEvent(lastEvent)
 {
@@ -156,7 +160,7 @@ AliMUONCheck::CheckESD(Bool_t pdc06TriggerResponse)
   if (!tree) 
   {
     Error("CheckESD", "no ESD tree found");
-    AliError(Form("CheckESD", "no ESD tree found"));
+    AliError(Form("no ESD tree found"));
     return ;
   }
   fESD->ReadFromTree(tree);
@@ -171,8 +175,7 @@ AliMUONCheck::CheckESD(Bool_t pdc06TriggerResponse)
   for (ievent = fFirstEvent; ievent < endOfLoop; ++ievent ) 
   {
     nev++;    
-    tree->GetEvent(ievent);
-    if (!fESD) 
+    if (tree->GetEvent(ievent) <= 0) 
     {
       Error("CheckESD", "no ESD object found for event %d", ievent);
       return ;
@@ -337,8 +340,7 @@ AliMUONCheck::CheckESD(Bool_t pdc06TriggerResponse)
   
   gSystem->cd(fkOutDir);
   
-  FILE *outtxt=fopen("output.txt","a");
-  freopen("output.txt","a",outtxt);
+  FILE *outtxt=fopen(fOutFileName.Data(),"a");
   
   if(pdc06TriggerResponse){
     fprintf(outtxt,"                                                   \n");
@@ -519,8 +521,7 @@ AliMUONCheck::CheckKine()
   printf("**************************************************************** \n");
   
   gSystem->cd(fkOutDir);
-  FILE *outtxt=fopen("output.txt","a");
-  freopen("output.txt","a",outtxt);
+  FILE *outtxt=fopen(fOutFileName.Data(),"a");
   fprintf(outtxt,"                                                   \n");
   fprintf(outtxt,"=================================================================\n");
   fprintf(outtxt,"================         MUONkine SUMMARY        ================\n");
@@ -780,7 +781,7 @@ AliMUONCheck::CheckOccupancy(Bool_t perDetEle) const
   
   // Output values
   
-  for ( Int_t ichamber = 0; ichamber < 14; ++ichamber ) 
+  for ( Int_t ichamber = 0; ichamber < nchambers; ++ichamber ) 
   {
     printf(">>> Chamber %2d  nChannels Bending %5d  nChannels NonBending %5d \n", 
          ichamber+1,