HV sector finder optimized + QA histograms added
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Apr 2008 11:41:34 +0000 (11:41 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Apr 2008 11:41:34 +0000 (11:41 +0000)
HMPID/AliHMPIDParam.h
HMPID/AliHMPIDQADataMakerRec.cxx
HMPID/AliHMPIDQADataMakerSim.cxx
HMPID/AliHMPIDTracker.cxx

index d705e99..533ab69 100644 (file)
@@ -62,7 +62,7 @@ public:
   Bool_t  GetInstType        (                               )const{return fgInstanceType;                            }  //return if the instance is from geom or ideal                        
   
   inline static Bool_t IsInDead(Float_t x,Float_t y        );                                                           //is the point in dead area?
-  inline static Int_t  InHVSector(Float_t x, Float_t y     );                                                           //find HV sector
+  inline static Int_t  InHVSector(           Float_t y     );                                                           //find HV sector
   static Bool_t  IsInside    (Float_t x,Float_t y,Float_t d=0)     {return  x>-d&&y>-d&&x<fgkMaxPcX[kMaxPc]+d&&y<fgkMaxPcY[kMaxPc]+d; } //is point inside chamber boundaries?
 
             Double_t   MeanIdxRad              ()const {return 1.29204;}   //<--TEMPORAR--> to be removed in future. Mean ref index C6F14
@@ -198,20 +198,20 @@ void AliHMPIDParam::Lors2Pad(Float_t x,Float_t y,Int_t &pc,Int_t &px,Int_t &py)
   else return;
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Int_t AliHMPIDParam::InHVSector(Float_t x, Float_t y)
+Int_t AliHMPIDParam::InHVSector(Float_t y)
 {
-    Int_t hvsec = 0;
-
-    if(x>=fgkMinPcY[0] && x<=(fgkMaxPcY[0]+fgkMinPcY[0])/2 && y>=fgkMinPcY[1] && y<=(fgkMaxPcY[1]+fgkMinPcY[1])/2) hvsec=0;
-    if(x>=(fgkMaxPcY[0]+fgkMinPcY[0])/2 && x<=fgkMaxPcY[0] && y>=(fgkMaxPcY[1]+fgkMinPcY[1])/2 && y<=fgkMaxPcY[1]) hvsec=1;
-    if(x>=fgkMinPcY[2] && x<=(fgkMaxPcY[2]+fgkMinPcY[2])/2 && y>=fgkMinPcY[3] && y<=(fgkMaxPcY[3]+fgkMinPcY[3])/2) hvsec=2;
-    if(x>=(fgkMaxPcY[2]+fgkMinPcY[2])/2 && x<=fgkMaxPcY[2] && y>=(fgkMaxPcY[3]+fgkMinPcY[3])/2 && y<=fgkMaxPcY[3]) hvsec=3;
-    if(x>=fgkMinPcY[4] && x<=(fgkMaxPcY[4]+fgkMinPcY[4])/2 && y>=fgkMinPcY[5] && y<=(fgkMaxPcY[5]+fgkMinPcY[5])/2) hvsec=4;
-    if(x>=(fgkMaxPcY[4]+fgkMinPcY[4])/2 && x<=fgkMaxPcY[4] && y>=(fgkMaxPcY[5]-fgkMinPcY[5])/2 && y<=fgkMaxPcY[5]) hvsec=5;
-
-    return hvsec;
-
- //in current pc
+//Calculate the HV sector corresponding to the cluster position
+//Arguments: y
+//Returns the HV sector in the single module
+   Int_t hvsec = -1;
+   Int_t pc,px,py;
+   Lors2Pad(1.,y,pc,px,py);
+   if(py==-1) return hvsec;
+   
+   hvsec = (py+(pc/2)*(kMaxPy+1))/((kMaxPy+1)/2);
+   
+   return hvsec;
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 #endif
index 06dd2e8..8d3b519 100644 (file)
@@ -21,7 +21,6 @@
 #include <TFile.h> 
 #include <TH1F.h> 
 #include <TH2F.h>
-#include <TProfile.h>
 #include <Riostream.h>
 // --- Standard library ---
 
@@ -34,6 +33,7 @@
 #include "AliHMPIDHit.h"
 #include "AliHMPIDCluster.h"
 #include "AliHMPIDQADataMakerRec.h"
+#include "AliHMPIDQAChecker.h"
 #include "AliHMPIDParam.h"
 #include "AliHMPIDRawStream.h"
 #include "AliLog.h"
@@ -79,15 +79,24 @@ void AliHMPIDQADataMakerRec::InitRecPoints()
 
   TH1F *hCluEvt=new TH1F("CluPerEvt","Cluster multiplicity"   ,100,0,100);
   TH1F *hCluChi2  =new TH1F("CluChi2"  ,"Chi2 "               ,1000,0,100);
-  TH1F *hCluFlg   =new TH1F("CluFlg"   ,"Cluster flag"        ,14,-1.5,12.5); hCluFlg->SetFillColor(5);
-  TH1F *hCluSize  =new TH1F("CluSize"  ,"Cluster size        ",100,0,100);
-  TH1F *hCluQ     =new TH1F("CluQ"     ,"Cluster charge (ADC)",1000,0,5000);
+  TH1F *hCluFlg   =new TH1F("CluFlg"   ,"Cluster flag"        ,14,-1.5,12.5);
+  TH1F *hCluSize     =new TH1F("CluSize"  ,"Cluster size        ",100,0,100);
+  TH1F *hCluSizeMip  =new TH1F("CluSizeMip"  ,"Cluster size  (cluster Q > 100 ADC)   ",100,0,100);
+  TH1F *hCluQ     =new TH1F("CluQ"     ,"Cluster charge (ADC)",5000,0,5000);
+  TH1F *hCluQSect[42];
+  for(Int_t iCh =0; iCh <7; iCh++){
+   for(Int_t iSect =0; iSect < 6; iSect++){
+      hCluQSect[iCh*6+iSect] = new TH1F(Form("QClusCh%iSect%i",iCh,iSect) ,Form("Cluster charge (ADC) in Chamber %i and sector %i",iCh,iSect),5000,0,5000);
+     }  
+  }
 
   Add2RecPointsList(hCluEvt , 0);
   Add2RecPointsList(hCluChi2, 1);
   Add2RecPointsList(hCluFlg , 2);
   Add2RecPointsList(hCluSize, 3);
-  Add2RecPointsList(hCluQ   , 4);
+  Add2RecPointsList(hCluSizeMip, 4);
+  Add2RecPointsList(hCluQ   , 5);
+  for(Int_t i=0; i< 42; i++)  Add2RecPointsList(hCluQSect[i],i+6);
 }
 //____________________________________________________________________________
 
@@ -123,8 +132,8 @@ void AliHMPIDQADataMakerRec::InitESDs()
   //Booking ESDs histograms
    TH2F*  hCkovP  = new TH2F("CkovP" , "#theta_{c}, [rad];P, [GeV]"   , 150,      0,  7  ,100, 0, 1)   ;
    TH2F*  hSigP   = new TH2F("SigP"  ,"#sigma_{#theta_c} [mrad];[GeV]", 150,      0,  7  ,100, 0, 1)   ;
-   TH2F*  hMipXY  = new TH2F("MipXY" ,"mip position"                  , 260,      0,130  ,252, 0,126)  ;
    TH2F*  hDifXY  = new TH2F("DifXY" ,"diff"                          , 200,    -10, 10  ,200,-10,10)  ;
+   TH2F*  hMvsP = new TH2F("MvsP","Reconstructed Mass vs P",60,0,6,1000,0,1) ;
    TH1F*  hPid[5];
    hPid[0] = new TH1F("PidE" ,"electron response"              , 101, -0.005,1.005)             ;
    hPid[1] = new TH1F("PidMu","#mu response"                   , 101, -0.005,1.005)             ;
@@ -134,9 +143,11 @@ void AliHMPIDQADataMakerRec::InitESDs()
 
 Add2ESDsList(hCkovP,0);
 Add2ESDsList(hSigP ,1);
-Add2ESDsList(hMipXY,2);
-Add2ESDsList(hDifXY,3);
+Add2ESDsList(hDifXY,2);
+Add2ESDsList(hMvsP,3);
 for(Int_t i=0; i< 5; i++) Add2ESDsList(hPid[i],i+4);
+
+
 }
 //____________________________________________________________________________
 void AliHMPIDQADataMakerRec::MakeRaws(AliRawReader *rawReader)
@@ -170,12 +181,13 @@ void AliHMPIDQADataMakerRec::MakeRecPoints(TTree * clustersTree)
   //
   //filling QA histos for clusters
   //
+
+  AliHMPIDParam *pPar =AliHMPIDParam::Instance();
   TClonesArray *clusters = new TClonesArray("AliHMPIDCluster");
   for(int i=AliHMPIDParam::kMinCh;i<=AliHMPIDParam::kMaxCh;i++){
     TBranch *branch = clustersTree->GetBranch(Form("HMPID%d",i));
     branch->SetAddress(&clusters);
     branch->GetEntry(0);
-
     GetRecPointsData(0)->Fill(i,clusters->GetEntries());
     TIter next(clusters);
     AliHMPIDCluster *clu;
@@ -183,7 +195,10 @@ void AliHMPIDQADataMakerRec::MakeRecPoints(TTree * clustersTree)
       GetRecPointsData(1)->Fill(clu->Chi2());
       GetRecPointsData(2)->Fill(clu->Status());
       GetRecPointsData(3)->Fill(clu->Size());
-      GetRecPointsData(4)->Fill(clu->Q()); 
+      if(clu->Q()>100) GetRecPointsData(3)->Fill(clu->Size());
+      GetRecPointsData(5)->Fill(clu->Q());
+      Int_t hv =  pPar->InHVSector(clu->Y()); 
+      GetRecPointsData(6+clu->Ch()*6+hv)->Fill(clu->Q());     
     }
   }
 
@@ -197,19 +212,26 @@ void AliHMPIDQADataMakerRec::MakeESDs(AliESDEvent * esd)
   //
   //fills QA histos for ESD
   //
+
   for(Int_t iTrk = 0 ; iTrk < esd->GetNumberOfTracks() ; iTrk++){
     AliESDtrack *pTrk = esd->GetTrack(iTrk) ;
     GetESDsData(0)->Fill(pTrk->GetP(),pTrk->GetHMPIDsignal());
     GetESDsData(1)->Fill( pTrk->GetP(),TMath::Sqrt(pTrk->GetHMPIDchi2()));
     Float_t xm,ym; Int_t q,np;  
     pTrk->GetHMPIDmip(xm,ym,q,np);                       //mip info
-    GetESDsData(2)->Fill(xm,ym);
     Float_t xRad,yRad,th,ph;        
     pTrk->GetHMPIDtrk(xRad,yRad,th,ph);              //track info at the middle of the radiator
     Float_t xPc = xRad+9.25*TMath::Tan(th)*TMath::Cos(ph); // temporar: linear extrapol (B=0!)
     Float_t yPc = yRad+9.25*TMath::Tan(th)*TMath::Sin(ph); // temporar:          "
-    GetESDsData(3)->Fill(xm-xPc,ym-yPc); //track info
-    Double_t pid[5] ;      pTrk->GetHMPIDpid(pid) ;
+    GetESDsData(2)->Fill(xm-xPc,ym-yPc); //track info
+    if(pTrk->GetHMPIDsignal()>0) {
+     Double_t a = 1.292*1.292*TMath::Cos(pTrk->GetHMPIDsignal())*TMath::Cos(pTrk->GetHMPIDsignal())-1.;
+     if(a > 0) {
+    Double_t mass = pTrk->P()*TMath::Sqrt(1.292*1.292*TMath::Cos(pTrk->GetHMPIDsignal())*TMath::Cos(pTrk->GetHMPIDsignal())-1.);
+    GetESDsData(3)->Fill( pTrk->GetP(),mass);
+     }
+    }
+   Double_t pid[5] ;      pTrk->GetHMPIDpid(pid) ;
     for(Int_t i = 0 ; i < 5 ; i++) GetESDsData(4+i)->Fill(pid[i]) ;
   }
 }
@@ -220,16 +242,11 @@ void AliHMPIDQADataMakerRec::StartOfDetectorCycle()
   
 }
 
-void AliHMPIDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray *)
+void AliHMPIDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t , TObjArray *)
 {
   //Detector specific actions at end of cycle
   // do the QA checking
-  //AliQAChecker::Instance()->Run(AliQA::kHMPID, task, obj);
-  //if(task==AliQA::kRAWS){  
 
-//   for(Int_t iddl=0; iddl<14; iddl++)
-//  {
-//  if(GetRawsData(28)->GetBinContent(iddl)!=0) GetRawsData(iddl+14)->Scale(100./GetRawsData(28)->GetBinContent(iddl));
-//  }
+ //  AliQAChecker::Instance()->Run(AliQA::kHMPID, task, obj);
 }
 
index 634794d..44f2b03 100644 (file)
@@ -21,7 +21,6 @@
 #include <TFile.h> 
 #include <TH1F.h> 
 #include <TH2F.h>
-#include <TProfile.h>
 #include <Riostream.h>
 // --- Standard library ---
 
@@ -89,18 +88,21 @@ void AliHMPIDQADataMakerSim::InitHits()
 void AliHMPIDQADataMakerSim::InitDigits()
 {
   // create Digits histograms in Digits subdir
-      TH1F *hDigPcEvt = new TH1F("hDigPcEvt","PC occupancy",156,-1,77);
-      TH1F *hDigQ     = new TH1F("Q        ","Charge of digits (ADC)     ",3000,0,3000);
       TH1F *hDigChEvt = new TH1F("hDigChEvt","Chamber occupancy per event",AliHMPIDParam::kMaxCh+1,AliHMPIDParam::kMinCh,AliHMPIDParam::kMaxCh+1);
+      TH1F *hDigPcEvt = new TH1F("hDigPcEvt","PC occupancy",156,-1,77);
+      TH2F *hDigMap[7];
+      TH1F *hDigQ[42];
+      for(Int_t iCh =0; iCh < 7; iCh++){
+       hDigMap[iCh] = new TH2F(Form("MapCh%i",iCh),Form("Digit Map in Chamber %i",iCh),159,0,159,143,0,143);
+       for(Int_t iPc =0; iPc < 6; iPc++ ){
+        hDigQ[iCh*6+iPc] = new TH1F(Form("QCh%iPc%i        ",iCh,iPc),Form("Charge of digits (ADC) in Chamber %i and PC %i   ",iCh,iPc),4100,0,4100);
+      }
+     }
 
-      TProfile *tDigHighQ = new TProfile("tDigHighQ","Highest charge in chamber  ",AliHMPIDParam::kMaxCh+1,AliHMPIDParam::kMinCh,AliHMPIDParam::kMaxCh+1);
-      TProfile *tDigChEvt = new TProfile("tDigChEvt","Chamber occupancy per event (profile)",AliHMPIDParam::kMaxCh+1,AliHMPIDParam::kMinCh,AliHMPIDParam::kMaxCh+1);
-
-Add2DigitsList(hDigPcEvt,0);
-Add2DigitsList(hDigQ    ,1);
-Add2DigitsList(hDigChEvt,2);
-Add2DigitsList(tDigHighQ,3);
-Add2DigitsList(tDigChEvt,4);
+   Add2DigitsList(hDigChEvt,0);
+   Add2DigitsList(hDigPcEvt,1);
+   for(Int_t iMap=0; iMap < 7; iMap++) Add2DigitsList(hDigMap[iMap],2+iMap);
+   for(Int_t iH =0; iH < 42 ; iH++) Add2DigitsList(hDigQ[iH]    ,9+iH);
 }
 
 //____________________________________________________________________________ 
@@ -150,6 +152,7 @@ void AliHMPIDQADataMakerSim::MakeDigits(TClonesArray * data)
  //
  //filling QA histos for Digits
  //
+
   TObjArray *chamber = dynamic_cast<TObjArray*>(data);
   if ( !chamber) {
     AliError("Wrong type of digits container") ; 
@@ -157,18 +160,14 @@ void AliHMPIDQADataMakerSim::MakeDigits(TClonesArray * data)
     for(Int_t i =0; i< chamber->GetEntries(); i++)
       {
        TClonesArray * digits = dynamic_cast<TClonesArray*>(chamber->At(i)); 
-       GetDigitsData(2)->Fill(i,digits->GetEntriesFast()/(48.*80.*6.));
-        GetDigitsData(4)->Fill(i,digits->GetEntriesFast()/(48.*80.*6.));
-        Double_t highQ=0;
+       GetDigitsData(0)->Fill(i,digits->GetEntriesFast()/(48.*80.*6.));
        TIter next(digits); 
        AliHMPIDDigit * digit; 
        while ( (digit = dynamic_cast<AliHMPIDDigit *>(next())) ) {
-         GetDigitsData(0)->Fill(10.*i+digit->Pc(),1./(48.*80.));
-         GetDigitsData(1)->Fill(digit->Q());
-          if(digit->Q()>highQ) highQ = digit->Q();
+         GetDigitsData(1)->Fill(10.*i+digit->Pc(),1./(48.*80.));
+          GetDigitsData(2+i)->Fill(digit->PadChX(),digit->PadChY());
+          GetDigitsData(9+i*6+digit->Pc())->Fill(digit->Q());
        }  
-      GetDigitsData(3)->Fill(i,highQ);
       }
   }
 }
@@ -235,10 +234,10 @@ void AliHMPIDQADataMakerSim::StartOfDetectorCycle()
   
 }
 
-void AliHMPIDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray *)
+void AliHMPIDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray *obj)
 {
   //Detector specific actions at end of cycle
   // do the QA checking
-//  AliQAChecker::Instance()->Run(AliQA::kHMPID, task, obj) ;  
+  AliQAChecker::Instance()->Run(AliQA::kHMPID, task, obj) ;  
 }
 
index 86bd4f3..99cf7a4 100644 (file)
@@ -110,7 +110,7 @@ Int_t AliHMPIDTracker::Recon(AliESDEvent *pEsd,TObjArray *pClus,TObjArray *pNmea
     if(pQthre->GetEntriesFast()==AliHMPIDParam::kMaxCh+1)                                        // just for backward compatibility
       qthre=((TF1*)pQthre->At(cham))->Eval(pEsd->GetTimeStamp());                                //
     else {                                                                                       // in the past just 1 qthre
-      Int_t hvsec = AliHMPIDParam::InHVSector(xPc,yPc);                                          //  per chamber
+      Int_t hvsec = AliHMPIDParam::InHVSector(yPc);                                              //  per chamber
       qthre=((TF1*)pQthre->At(6*cham+hvsec))->Eval(pEsd->GetTimeStamp());                        //
     }                                                                                            //
     recon.SetImpPC(xPc,yPc);                                                                     //store track impact to PC