]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New functions to set the acceptance of parts of the chambers. Minors.
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 1 Jun 2010 09:10:56 +0000 (09:10 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 1 Jun 2010 09:10:56 +0000 (09:10 +0000)
HMPID/AliHMPIDParam.cxx
HMPID/AliHMPIDParam.h
HMPID/AliHMPIDRecon.cxx
HMPID/AliHMPIDRecon.h

index ae7045f66026c8762e9b193ff3bf88e49f791fa4..f6fae4cc9b938dd2e69d5da2e698a07888b54433 100644 (file)
@@ -51,6 +51,8 @@ Float_t AliHMPIDParam::fgkMaxPcX[]={0.,0.,0.,0.,0.,0.};
 Float_t AliHMPIDParam::fgkMinPcY[]={0.,0.,0.,0.,0.,0.};
 Float_t AliHMPIDParam::fgkMaxPcY[]={0.,0.,0.,0.,0.,0.};
 
+Bool_t AliHMPIDParam::fgMapPad[160][144][7];
+
 Float_t AliHMPIDParam::fgCellX=0.;
 Float_t AliHMPIDParam::fgCellY=0.;
 
@@ -134,7 +136,17 @@ AliHMPIDParam::AliHMPIDParam(Bool_t noGeo=kFALSE):
   fX=0.5*SizeAllX();
   fY=0.5*SizeAllY();
   
-  for(Int_t i=kMinCh;i<=kMaxCh;i++) 
+      
+  for(Int_t ich=kMinCh;ich<=kMaxCh;ich++) {
+    for(Int_t padx=0;padx<160;padx++) {
+       for(Int_t pady=0;pady<144;pady++) {
+         fgMapPad[padx][pady][ich] = kTRUE;             //init all the pads are active at the beginning....
+       }
+     }
+   }
+     
+
+  for(Int_t i=kMinCh;i<=kMaxCh;i++)
     if(gGeoManager && gGeoManager->IsClosed()) {
       TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(Form("/HMPID/Chamber%i",i));
       if (!pne) {
index 7f5e0bb0b17dd90f798f3dc52f5f912f7110bc43..a86dd334c0fb3e604a9b978b1a0e411904baada2 100644 (file)
@@ -5,6 +5,7 @@
 
 /* $Id$ */
 
+#include "stdio.h"
 #include <TMath.h>
 #include <TNamed.h>        //base class
 #include <TGeoManager.h>   //Instance()
@@ -69,6 +70,13 @@ 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 Bool_t IsDeadPad(Int_t padx,Int_t pady,Int_t ch);                                                       //is a dead pad?
+  
+  inline void SetChStatus(Int_t ch,Bool_t status=kTRUE);
+  inline void SetSectStatus(Int_t ch,Int_t sect,Bool_t status); 
+  inline void SetPcStatus(Int_t ch,Int_t pc,Bool_t status); 
+  inline void PrintChStatus(Int_t ch);
+  
   inline static Int_t  InHVSector(           Float_t y     );                                                           //find HV sector
   static Int_t  Radiator(          Float_t y               )       {if (InHVSector(y)<0) return -1; return InHVSector(y)/2;}
   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?
@@ -154,6 +162,8 @@ protected:
   static /*const*/ Float_t fgkMaxPcX[6];                                                           //limits PC
   static /*const*/ Float_t fgkMaxPcY[6]; 
   
+  static Bool_t fgMapPad[160][144][7];                                                                   //map of pads to evaluate if they are active or dead (160,144) pads for 7 chambers
+  
 // Mathieson constants
 // For HMPID --> x direction means parallel      to the wires: K3 = 0.66  (NIM A270 (1988) 602-603) fig.1  
 // For HMPID --> y direction means perpendicular to the wires: K3 = 0.90  (NIM A270 (1988) 602-603) fig.2  
@@ -216,6 +226,17 @@ Bool_t AliHMPIDParam::IsInDead(Float_t x,Float_t y)
   return kTRUE;
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Bool_t AliHMPIDParam::IsDeadPad(Int_t padx,Int_t pady,Int_t ch)
+{
+// Check is the current pad is active or not
+// Arguments: padx,pady pad integer coord
+//   Returns: kTRUE if dead, kFALSE if active
+
+    if(fgMapPad[padx-1][pady-1][ch]) return kFALSE; //current pad active
+  
+  return kTRUE;
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDParam::Lors2Pad(Float_t x,Float_t y,Int_t &pc,Int_t &px,Int_t &py)
 {
 // Check the pad of given position
@@ -259,4 +280,71 @@ Double_t AliHMPIDParam::FindTemp(Double_t tLow,Double_t tHigh,Double_t y)
   return tLow + TMath::Power(y/halfPadSize,1./gradT);  
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void AliHMPIDParam::SetChStatus(Int_t ch,Bool_t status)
+{
+//Set a chamber on or off depending on the status
+//Arguments: ch=chamber,status=kTRUE = active, kFALSE=off
+//Returns: none
+  for(Int_t padx=0;padx<kMaxPcx+1;padx++) {
+     for(Int_t pady=0;pady<kMaxPcy+1;pady++) {
+       fgMapPad[padx][pady][ch] = status;
+     }
+   }
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void AliHMPIDParam::SetSectStatus(Int_t ch,Int_t sect,Bool_t status)
+{
+//Set a given sector sect for a chamber ch on or off depending on the status
+//Sector=0,5 (6 sectors)
+//Arguments: ch=chamber,sect=sector,status: kTRUE = active, kFALSE=off
+//Returns: none
+  
+  Int_t npadsect = (kMaxPcy+1)/6;
+  Int_t padSectMin = npadsect*sect;
+  Int_t padSectMax = padSectMin+npadsect;
+  
+  for(Int_t padx=0;padx<kMaxPcx+1;padx++) {
+     for(Int_t pady=padSectMin;pady<padSectMax;pady++) {
+       fgMapPad[padx][pady][ch] = status;
+     }
+   }
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void AliHMPIDParam::SetPcStatus(Int_t ch,Int_t pc,Bool_t status)
+{
+//Set a given PC pc for a chamber ch on or off depending on the status
+//Arguments: ch=chamber,pc=PC,status: kTRUE = active, kFALSE=off
+//Returns: none
+  
+  Int_t deltaX = pc%2;
+  Int_t deltaY = pc/2;
+  Int_t padPcXMin = deltaX*kPadPcX;
+  Int_t padPcXMax = padPcXMin+kPadPcX;
+  Int_t padPcYMin = deltaY*kPadPcY;
+  Int_t padPcYMax = padPcYMin+kPadPcY;
+  
+  for(Int_t padx=padPcXMin;padx<padPcXMax;padx++) {
+     for(Int_t pady=padPcYMin;pady<padPcYMax;pady++) {
+       fgMapPad[padx][pady][ch] = status;
+     }
+   }
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void AliHMPIDParam::PrintChStatus(Int_t ch)
+{
+//Print the map status of a chamber on or off depending on the status
+//Arguments: ch=chamber
+//Returns: none
+  Printf(" ");
+  Printf(" --------- C H A M B E R  %d   ---------------",ch);
+  for(Int_t pady=kMaxPcy;pady>=0;pady--) {
+     for(Int_t padx=0;padx<kMaxPcx+1;padx++) {
+       if(padx==80) printf(" ");
+       printf("%d",fgMapPad[padx][pady][ch]);
+     }
+     printf(" %d \n",pady+1);
+     if(pady%48==0) Printf("");
+   }
+   Printf("");
+}
 #endif
index 630716a58d99862692b45e1b390c9619cfb19932..932acde8b4b8c12d5b1ad8145a2d3da6e43afe5a 100644 (file)
@@ -474,7 +474,7 @@ Double_t AliHMPIDRecon::HoughResponse()
   return (Double_t)(locMax*fDTheta+0.5*fDTheta); //final most probable track theta ckov   
 }//HoughResponse()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-  Double_t AliHMPIDRecon::FindRingExt(Double_t ckov,Double_t xPc,Double_t yPc,Double_t thRa,Double_t phRa)
+  Double_t AliHMPIDRecon::FindRingExt(Double_t ckov,Int_t ch,Double_t xPc,Double_t yPc,Double_t thRa,Double_t phRa)
 {
 // To find the acceptance of the ring even from external inputs. 
 //    
@@ -484,12 +484,16 @@ Double_t AliHMPIDRecon::HoughResponse()
   
   Int_t nStep = 500;
   Int_t nPhi = 0;  
-  
+
+  Int_t ipc,ipadx,ipady;
+    
   if(ckov>0){
     SetTrack(xRa,yRa,thRa,phRa);
     for(Int_t j=0;j<nStep;j++){
       TVector2 pos; pos=TracePhot(ckov,j*TMath::TwoPi()/(Double_t)(nStep-1));
       if(fParam->IsInDead(pos.X(),pos.Y())) continue;
+      fParam->Lors2Pad(pos.X(),pos.Y(),ipc,ipadx,ipady);
+      if(fParam->IsDeadPad(ipadx,ipady,ch)) continue;
       nPhi++;
     }//point loop
   return ((Double_t)nPhi/(Double_t)nStep); 
index 050109c07519e5f6f72268392e92657d674b1c07..8b1f8dc1268dc9e149dd291884e8a83bc0dcb3e4 100644 (file)
@@ -47,7 +47,7 @@ public :
                         {return fRingArea;}                                                        //area of the current ring in cm^2 
   Double_t GetRingAcc   (                                                                   )const
                         {return fRingAcc;}                                                         //portion of the ring ([0,1]) accepted by geometry.To scale n. of photons 
-  Double_t FindRingExt  (Double_t ckov,Double_t xPc,Double_t yPc,Double_t thRa,Double_t phRa);     //find ring acceptance by external parameters
+  Double_t FindRingExt  (Double_t ckov,Int_t ch,Double_t xPc,Double_t yPc,Double_t thRa,Double_t phRa);//find ring acceptance by external parameters
   void     SetTrack     (Double_t xRad,Double_t yRad,Double_t theta,Double_t phi            )
                                 {fTrkDir.SetMagThetaPhi(1,theta,phi);  fTrkPos.Set(xRad,yRad);}    //set track parameter at RAD
   void     SetImpPC     (Double_t xPc,Double_t yPc                                          )