Add tools in RichMenu
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 9 Jun 2005 05:18:27 +0000 (05:18 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 9 Jun 2005 05:18:27 +0000 (05:18 +0000)
RICH/AliRICH.cxx
RICH/AliRICH.h
RICH/RichMenu.C

index 7688bcb..d4ce7d5 100644 (file)
@@ -686,6 +686,22 @@ void AliRICH::DigitsPrint(Int_t iEvtN)const
   Info("PrintDigits","totally %i Digits",iTotalDigits);
 }
 //__________________________________________________________________________________________________
+void AliRICH::OccupancyPrint(Int_t iEvtN)const
+{
+//prints occupancy for each chamber in a given event
+  if(GetLoader()->GetRunLoader()->GetEvent(iEvtN)) return;    
+  Info("Occupancy","for event %i",iEvtN);
+  if(GetLoader()->LoadDigits()) return;
+
+  Int_t totPadsPerChamber = AliRICHParam::NpadsX()*AliRICHParam::NpadsY();  
+  GetLoader()->TreeD()->GetEntry(0);
+  for(Int_t iChamber=1;iChamber<=kNchambers;iChamber++){
+    Double_t occupancy = (Double_t)Digits(iChamber)->GetEntries()/(Double_t)totPadsPerChamber;
+    Info("Occupancy","for chamber %i = %4.2f per cent",iChamber,occupancy*100.);
+  }
+  GetLoader()->UnloadDigits();
+}
+//__________________________________________________________________________________________________
 void AliRICH::ClustersPrint(Int_t iEvtN)const
 {
 //prints a list of RICH clusters  for a given event
index bc16d12..2789b1f 100644 (file)
@@ -71,6 +71,8 @@ public:
   inline void          ClustersCreate(                                                       )     ;                                                  //create clusters container
          void          ClustersReset (                                                       )     {if(fClus)for(int i=0;i<kNchambers;i++){fClus ->At(i)->Clear();fNclus[i]=0;}}
          void          ClustersPrint (Int_t iEvent=0                                         )const;                        //prints a list of clusters for a given event
+
+         void          OccupancyPrint(Int_t iEvent=0                                         )const;
          
   AliRICHChamber* C(Int_t iC)           const{return fParam->C(iC);}   //provides pointer to a given chamber
   AliRICHParam*   P()                   const{return fParam;}          //provides pointer to a RICH params
index bdff392..5b3f0a3 100644 (file)
@@ -103,6 +103,7 @@ void MenuRich()
   pMenu->AddButton("Print sdigits"    ,"r->SDigitsPrint();"   ,"????");
   pMenu->AddButton("Print digits"     ,"r->DigitsPrint();"    ,"????");
   pMenu->AddButton("Print clusters"   ,"r->ClustersPrint();"  ,"????");  
+  pMenu->AddButton("Print occupancy"  ,"r->OccupancyPrint();" ,"????");  
   pMenu->AddButton("Hits plots"       ,"r->ControlPlots()"    ,"????");
   pMenu->AddButton("Recon with stack" ,"r->CheckPR()"                                           , "Create RSR.root with ntuple hn");    
   pMenu->Show();