]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
option to put flat ref idx
authorkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 6 May 2007 13:36:02 +0000 (13:36 +0000)
committerkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 6 May 2007 13:36:02 +0000 (13:36 +0000)
HMPID/AliHMPID.cxx
HMPID/AliHMPID.h
HMPID/AliHMPIDParam.h
HMPID/AliHMPIDTracker.cxx
HMPID/AliHMPIDTracker.h
HMPID/AliHMPIDv1.cxx
HMPID/AliHMPIDv2.cxx
HMPID/Hconfig.C
HMPID/Hqa.C

index 223addbc465daaf184fb9eb590458a0a0dbc3cab..47a78b21f37c239caeb4f0a1ac0ce779ee3dc773 100644 (file)
 #include <TH1F.h>        //HitQA()
 #include <AliLog.h>      //in many methods to print AliInfo 
 
-Bool_t AliHMPID::fgDoFeed=kTRUE;
 ClassImp(AliHMPID)    
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-AliHMPID::AliHMPID(const char *name, const char *title):AliDetector(name,title),fSdi(0),fDig(0),fClu(0)
+AliHMPID::AliHMPID(const char *name, const char *title):AliDetector(name,title),fDoFeed(kTRUE),fSdi(0),fDig(0),fClu(0)
 {
 //Named ctor
   AliDebug(1,"Start.");
 //AliDetector ctor deals with Hits and Digits (reset them to 0, does not create them)
   HitCreate();          gAlice->GetMCApp()->AddHitList(fHits);
+  
+  TString ttl=title;
+  fDoFeed=!ttl.Contains("NoFeedBack");
   AliDebug(1,"Stop.");
 }//AliHMPID::AliHMPID(const char *name, const char *title)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
index b648eecb82c579583b77ba9f3c8d4ec6b24986e2..52a12e16bbc431d8c8103593fffe80a7ad3752e7 100644 (file)
@@ -15,8 +15,8 @@ class AliHMPID : public AliDetector //TObject-TNamed-AliModule-AliDetector-AliHM
 {
 public:
 //ctor & dtor    
-            AliHMPID(const char *nm,const char *ttl);                                              //named ctor
-            AliHMPID(                              ):AliDetector(    ),fSdi(0),fDig(0),fClu(0) {}  //default ctor          
+            AliHMPID(const char *nm,const char *ttl);                                                           //named ctor
+            AliHMPID(                              ):AliDetector(    ),fDoFeed(kTRUE),fSdi(0),fDig(0),fClu(0) {}  //default ctor          
   virtual  ~AliHMPID();                                            
 //framework part  
           void  BuildGeometry   (                ) {}          //from AliModule invoked from AliMC::InitGeometry() to build geometry for old event display
@@ -29,7 +29,6 @@ public:
           void  MakeBranch      (Option_t *opt="");            //from AliModule invokde from AliRun::Tree2Tree() to make requested HMPID branch
           void  SetTreeAddress  (                );            //from AliModule invoked from AliRun::GetEvent(), AliLoader::SetTAddrInDet()
   virtual void  StepManager     (                )=0;          //from AliModule invoked from AliMC
-          void  DoFeed          (Bool_t doFeed   ){fgDoFeed=doFeed;} // Set feedback photons
 //private part +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
   void          HitCreate(         )     {if(fHits)return; fHits=new TClonesArray("AliHMPIDHit"); fNhits=0;     }//create hits list
               
@@ -51,7 +50,7 @@ public:
     fClu=new TObjArray(7); for(Int_t i=0;i<7;i++)fClu->AddAt(new TClonesArray("AliHMPIDCluster"),i);            }//create clusters list
          void   CluReset (         )     {if(fClu)for(int i=0;i<7;i++)fClu->At(i)->Clear();                     }//clean clusters list
 protected:  
-  static  Bool_t fgDoFeed;                        //Flag to switch on/off Feedback photon creation
+  Bool_t                fDoFeed;                  //! Flag to switch on/off Feedback photon creation
   TClonesArray         *fSdi;                     //! list of sdigits  
   TObjArray            *fDig;                     //! each chamber holds it's one list of digits
   TObjArray            *fClu;                     //! each chamber holds it's one list of clusters 
index 82f950f3c53145bb4907fdbb474bf99c3c551cfc..9c68b307bbefaf6d8a72d182db18a73cf35a702c 100644 (file)
@@ -33,14 +33,14 @@ public:
   //trasformation methodes
   void     Lors2Mars   (Int_t c,Float_t x,Float_t y,Double_t *m,Int_t pl=kPc)const{Double_t z=0; switch(pl){case kPc:z=8.0;break; case kAnod:z=7.806;break; case kRad:z=-1.25; break;}   Double_t l[3]={x-fX,y-fY,z};  fM[c]->LocalToMaster(l,m); }    
   TVector3 Lors2Mars   (Int_t c,Float_t x,Float_t y,            Int_t pl=kPc)const{Double_t m[3];Lors2Mars(c,x,y,m,pl); return TVector3(m);    }//MRS->LRS  
-  void     Mars2Lors   (Int_t c,Double_t *m,Float_t &x,Float_t &y           )const{Double_t l[3];fM[c]->MasterToLocal(m,l);x=l[0]+fX;y=l[1]+fY;}//MRS->LRS
+  void     Mars2Lors   (Int_t c,Double_t *m,Float_t &x ,Float_t &y          )const{Double_t l[3];fM[c]->MasterToLocal(m,l);x=l[0]+fX;y=l[1]+fY;}//MRS->LRS
   void     Mars2LorsVec(Int_t c,Double_t *m,Float_t &th,Float_t &ph         )const{Double_t l[3]; fM[c]->MasterToLocalVect(m,l); 
                                                                                    Float_t pt=TMath::Sqrt(l[0]*l[0]+l[1]*l[1]); 
                                                                                            th=TMath::ATan(pt/l[2]); 
                                                                                            ph=TMath::ATan2(l[1],l[0]);}    
   TVector3 Norm        (Int_t c                                             )const{Double_t n[3]; Norm(c,n); return TVector3(n);               }//norm 
   void     Norm        (Int_t c,Double_t *n                                 )const{Double_t l[3]={0,0,1};fM[c]->LocalToMasterVect(l,n);        }//norm
-  
+  void     Point       (Int_t c,Double_t *p,Int_t plane                     )const{Lors2Mars(c,0,0,p,plane);}      //point of given chamber plane
   enum EPlaneId {kPc,kRad,kAnod};            //3 planes in chamber 
 protected:
          AliHMPIDParam();             //default ctor is protected to enforce it to be singleton
index aef985793de6ba903555d2f86086b7aabc17b1bd..a13b1e234033810f1770510a8701e3f998dc54af 100644 (file)
@@ -1,13 +1,13 @@
 #include "AliHMPIDTracker.h"     //class header
 #include "AliHMPIDCluster.h"     //GetTrackPoint(),PropagateBack() 
 #include "AliHMPIDParam.h"       //GetTrackPoint(),PropagateBack()
-#include "AliHMPIDRecon.h"       //PropagateBack()
-#include <AliESD.h>              //PropagateBack()  
+#include "AliHMPIDRecon.h"       //Recon()
+#include <AliESD.h>              //PropagateBack(),Recon()  
 #include <AliRun.h>              //GetTrackPoint(),PropagateBack()  
 #include <AliTrackPointArray.h>  //GetTrackPoint()
 #include <AliAlignObj.h>         //GetTrackPoint()
-#include <AliCDBManager.h>
-#include <AliCDBEntry.h>
+#include <AliCDBManager.h>       //PropageteBack()
+#include <AliCDBEntry.h>         //PropageteBack()
 //.
 // HMPID base class fo tracking
 //.
@@ -17,11 +17,12 @@ ClassImp(AliHMPIDTracker)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 AliHMPIDTracker::AliHMPIDTracker():AliTracker()
 {
-// ctor
-  fClu=new TObjArray(AliHMPIDDigit::kMaxCh+1);
-  fClu->SetOwner(kTRUE);
+// ctor. Create TObjArray of TClonesArray of AliHMPIDCluster  
+// 
+//  
+  fClu=new TObjArray(AliHMPIDDigit::kMaxCh+1);  fClu->SetOwner(kTRUE);
   for(int i=AliHMPIDDigit::kMinCh;i<=AliHMPIDDigit::kMaxCh;i++) fClu->AddAt(new TClonesArray("AliHMPIDCluster"),i);
-}
+}//ctor
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    
 Bool_t AliHMPIDTracker::GetTrackPoint(Int_t idx, AliTrackPoint& point) const
 {
@@ -31,8 +32,7 @@ Bool_t AliHMPIDTracker::GetTrackPoint(Int_t idx, AliTrackPoint& point) const
 //            point- reference to the object where to store the point     
 //   Returns: status of operation  if FALSE then AliReconstruction::WriteAlignmentData() do not store this point to array of points for current track. 
   if(idx<0) return kFALSE; //no MIP cluster assigned to this track in PropagateBack()
-  Int_t iCham=idx/1000000;
-  Int_t iClu=idx%1000000;
+  Int_t iCham=idx/1000000; Int_t iClu=idx%1000000;
   point.SetVolumeID(AliAlignObj::LayerToVolUID(AliAlignObj::kHMPID,iCham-1));//layer and chamber number
   TClonesArray *pArr=(TClonesArray*)(*fClu)[iCham];
   AliHMPIDCluster *pClu=(AliHMPIDCluster*)pArr->UncheckedAt(iClu);//get pointer to cluster
@@ -40,23 +40,44 @@ Bool_t AliHMPIDTracker::GetTrackPoint(Int_t idx, AliTrackPoint& point) const
   AliHMPIDParam::Instance()->Lors2Mars(iCham,pClu->X(),pClu->Y(),mars);
   point.SetXYZ(mars[0],mars[1],mars[2]);
   return kTRUE;
-}
+}//GetTrackPoint()
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Int_t AliHMPIDTracker::IntTrkCha(AliESDtrack *pTrk,Float_t &xPc,Float_t &yPc)
+{
+// Static method to find intersection in between given track and HMPID chambers
+// Arguments: pTrk- ESD track; xPc,yPc- track intersection with PC in LORS [cm]
+//   Returns: intersected chamber ID or -1
+  AliHMPIDParam *pParam=AliHMPIDParam::Instance();
+  Float_t xRa=0,yRa=0,theta=0,phi=0;                                                            //track intersection at PC and angles at RAD, LORS  
+  for(Int_t i=AliHMPIDDigit::kMinCh;i<=AliHMPIDDigit::kMaxCh;i++){                              //chambers loop
+    Double_t p1[3],n1[3]; pParam->Norm(i,n1); pParam->Point(i,p1,AliHMPIDParam::kRad);          //point & norm  for middle of radiator plane
+    Double_t p2[3],n2[3]; pParam->Norm(i,n2); pParam->Point(i,p2,AliHMPIDParam::kPc);           //point & norm  for entrance to PC plane
+    if(pTrk->Intersect(p1,n1,-GetBz())==kFALSE) continue;                                       //try to intersect track with the middle of radiator
+    if(pTrk->Intersect(p2,n2,-GetBz())==kFALSE) continue;                                       //try to intersect track with PC
+    pParam->Mars2LorsVec(i,n1,theta,phi);                                                       //track angles at RAD
+    pParam->Mars2Lors   (i,p1,xRa,yRa);                                                         //TRKxRAD position
+    pParam->Mars2Lors   (i,p2,xPc,yPc);                                                         //TRKxPC position
+    if(AliHMPIDDigit::IsInside(xPc,yPc,pParam->DistCut())==kFALSE) continue;                    //not in active area  
+    pTrk->SetHMPIDtrk      (xRa,yRa,theta,phi);                                                 //store track intersection info
+    pTrk->SetHMPIDcluIdx   (i,0);
+    return i;
+  }                                                                                             //chambers loop
+  return -1; //no intersection with HMPID chambers
+}//IntTrkCha()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Int_t AliHMPIDTracker::LoadClusters(TTree *pCluTree)
 {
-// Interface callback methode invoked from AliReconstruction::RunTracking() to load HMPID clusters before PropagateBack() gets control 
+// Interface callback methode invoked from AliReconstruction::RunTracking() to load HMPID clusters before PropagateBack() gets control. Done once per event.
 // Arguments: pCluTree- pointer to clusters tree got by AliHMPIDLoader::LoadRecPoints("read") then AliHMPIDLoader::TreeR()
 //   Returns: error code (currently ignored in AliReconstruction::RunTraking())    
-  AliDebug(1,"Start.");
   for(int i=AliHMPIDDigit::kMinCh;i<=AliHMPIDDigit::kMaxCh;i++) pCluTree->SetBranchAddress(Form("HMPID%d",i),&((*fClu)[i]));
   pCluTree->GetEntry(0);
-  AliDebug(1,"Stop."); 
   return 0;  
-}
+}//LoadClusters()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Int_t AliHMPIDTracker::PropagateBack(AliESD *pEsd)
 {
-// This method defined as pure virtual in AliTracker. It is invoked from AliReconstruction::RunTracking() after invocation of AliTracker::LoadClusters()
+// Interface pure virtual in AliTracker. Invoked from AliReconstruction::RunTracking() after invocation of AliTracker::LoadClusters() once per event
 // Agruments: pEsd - pointer to ESD
 //   Returns: error code    
   AliCDBEntry *pNmeanEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Nmean"); //contains TObjArray of 21 TF1
@@ -67,51 +88,21 @@ Int_t AliHMPIDTracker::PropagateBack(AliESD *pEsd)
   return Recon(pEsd,fClu,(TObjArray*)pNmeanEnt->GetObject());  
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Int_t AliHMPIDTracker::Recon(AliESD *pEsd,TObjArray *pCluAll,TObjArray *pNmean)
+Int_t AliHMPIDTracker::Recon(AliESD *pEsd,TObjArray *pClus,TObjArray *pNmean)
 {
-// Interface callback method invoked by AliRecontruction::RunTracking() during tracking after TOF. It's done just once per event
-// Arguments: pEsd - pointer to Event Summary Data class instance which contains a list of tracks
+// Static method to reconstruct Theta Ckov for all valid tracks of a given event.
+// Arguments: pEsd- pointer ESD; pClu- pointer to clusters for all chambers; pNmean - pointer to all function Nmean=f(time)
 //   Returns: error code, 0 if no errors   
-  Int_t iNtracks=pEsd->GetNumberOfTracks();  AliDebugClass(1,Form("Start with %i tracks",iNtracks));
-  
   AliHMPIDRecon recon;                                                                       //instance of reconstruction class, nothing important in ctor
-  Double_t xPc,yPc;
-  for(Int_t iTrk=0;iTrk<iNtracks;iTrk++){                                                        //ESD tracks loop
-    AliESDtrack *pTrk = pEsd->GetTrack(iTrk);                                                    //get next reconstructed track    
+  Float_t xPc,yPc;
+  for(Int_t iTrk=0;iTrk<pEsd->GetNumberOfTracks();iTrk++){                                       //ESD tracks loop
+    AliESDtrack *pTrk = pEsd->GetTrack(iTrk);                                                    //get reconstructed track    
     Int_t cham=IntTrkCha(pTrk,xPc,yPc);                                                          //get chamber intersected by this track 
     if(cham<0) continue;                                                                         //no intersection at all, go after next track
     Double_t nmean=((TF1*)pNmean->At(3*cham))->Eval(pEsd->GetTimeStamp());                       //C6F14 Nmean for this chamber
     recon.SetImpPC(xPc,yPc);                                                                     //store track impact to PC
-    recon.CkovAngle(pTrk,(TClonesArray *)pCluAll->At(cham),nmean);                               //search for Cerenkov angle of this track
+    recon.CkovAngle(pTrk,(TClonesArray *)pClus->At(cham),nmean);                                 //search for Cerenkov angle of this track
   }                                                                                              //ESD tracks loop
-  AliDebugClass(1,"Stop pattern recognition");
   return 0; // error code: 0=no error;
 }//PropagateBack()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Int_t AliHMPIDTracker::IntTrkCha(AliESDtrack *pTrk,Double_t &xToPc,Double_t &yToPc)
-{
-// Static method to find intersection in between given track and HMPID chambers
-// Arguments: pTrk    - ESD track 
-//            xPc,yPc - track intersection with PC, LORS
-//   Returns: intersected chamber ID or -1
-  
-  AliHMPIDParam *pParam=AliHMPIDParam::Instance();
-  Float_t xRa=0,yRa=0,xPc=0,yPc=0,theta=0,phi=0;                                                //track intersection point and angles, LORS  
-  for(Int_t i=AliHMPIDDigit::kMinCh;i<=AliHMPIDDigit::kMaxCh;i++){                              //chambers loop
-    Double_t p1[3],n1[3]; pParam->Norm(i,n1); pParam->Lors2Mars(i,0,0,p1,AliHMPIDParam::kRad);  //point & norm  for RAD
-    Double_t p2[3],n2[3]; pParam->Norm(i,n2); pParam->Lors2Mars(i,0,0,p2,AliHMPIDParam::kPc);   //point & norm  for PC
-      
-    if(pTrk->Intersect(p1,n1,-GetBz())==kFALSE) continue;                                       //try to intersect track with the middle of radiator
-    if(pTrk->Intersect(p2,n2,-GetBz())==kFALSE) continue;                                       //try to intersect track with PC
-      
-    pParam->Mars2LorsVec(i,n1,theta,phi);                                                       //track angles at RAD
-    pParam->Mars2Lors   (i,p1,xRa,yRa);                                                         //TRKxRAD position
-    pParam->Mars2Lors   (i,p2,xPc,yPc);                                                         //TRKxPC position
-    xToPc=(Double_t)xPc;yToPc=(Double_t)yPc;                                                    //conversion float->double only
-    if(AliHMPIDDigit::IsInside(xPc,yPc,pParam->DistCut())==kFALSE) continue;             //not in active area  
-    pTrk->SetHMPIDtrk      (xRa,yRa,theta,phi);                                                 //store track intersection info
-    pTrk->SetHMPIDcluIdx   (i,0);
-    return i;
-  }                                                                                             //chambers loop
-  return -1; //no intersection with HMPID chambers
-}
index 216a86a3b13e7160566c611ef8ec05eab97a464b..5750fb2c585b7646f679c93c3824d254cf14a008 100644 (file)
@@ -25,11 +25,10 @@ public:
          Int_t       RefitInward    (AliESD *                   )       {return 0;} //pure virtual from AliTracker 
          void        UnloadClusters (                           )       {         } //pure virtual from AliTracker 
 //private part  
-  static Int_t       IntTrkCha(AliESDtrack *pTrk,Double_t &xPc,Double_t &yPc);              //find track-PC intersection, retuns chamber ID
-  static Int_t       Recon    (AliESD *pEsd,TObjArray *pCluAll,TObjArray *pNmean=0);        //do actual job, returns status code  
+  static Int_t       IntTrkCha(AliESDtrack *pTrk,Float_t &xPc,Float_t &yPc        );//find track-PC intersection, retuns chamber ID
+  static Int_t       Recon    (AliESD *pEsd,TObjArray *pCluAll,TObjArray *pNmean=0);//do actual job, returns status code  
 protected:
   TObjArray            *fClu;                     //! each chamber holds it's one list of clusters 
-
 ClassDef(AliHMPIDTracker,0)
 };//class AliHMPIDTracker
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
index 1600e12f121e5520ec2bbd1c3e4fa188f058d956..ddbbef29210aa4d33782a50026b3860a59d38586 100644 (file)
@@ -550,7 +550,7 @@ void AliHMPIDv1::StepManager()
       eloss=0;                                                                                    //reset Eloss collector                         
       gMC->TrackPosition(in[0],in[1],in[2]);                                                      //take position at the entrance
     }else if(gMC->IsTrackExiting()||gMC->IsTrackStop()||gMC->IsTrackDisappeared()){               //exiting or disappeared
-      eloss              +=gMC->Edep();                                                            //take into account last step Eloss
+      eloss              +=gMC->Edep();                                                           //take into account last step Eloss
                           gMC->CurrentVolOffID(1,copy);                                           //take current chamber since geometry tree is HMPID-Rgap
       Int_t tid=          gMC->GetStack()->GetCurrentTrackNumber();                               //take TID
       Int_t pid=          gMC->TrackPid();                                                        //take PID
index 03d894010d038169f0ba49641d98110575c26d36..ab3dd2fbfaceb094fd14829272e774bc1c1ea7da 100644 (file)
@@ -324,13 +324,16 @@ void AliHMPIDv2::DefineOpticalProperties()
   TF1 *pGaAF=new TF1("HabsGap","(x<7.75)*6512.399+(x>=7.75)*3.90743e-2/(-1.655279e-1+6.307392e-2*x-8.011441e-3*x*x+3.392126e-4*x*x*x)",emin,emax);  //????? from where  
   
   TF1 *pQeF =new TF1("Hqe"    ,"0+(x>6.07267)*0.344811*(1-exp(-1.29730*(x-6.07267)))"                                                 ,emin,emax);  //fit from DiMauro data 28.10.03  
-                            
+                   
+  TString title=GetTitle();
+  Bool_t isFlatIdx=title.Contains("FlatIdx"); 
+  
   for(Int_t i=0;i<kNbins;i++){
     Float_t eV=emin+0.1*i;  //Ckov energy in eV
     aEckov [i] =1e-9*eV;    //Ckov energy in GeV
-    aAbsRad[i]=pRaAF->Eval(eV); aIdxRad[i]=1.292;//pRaIF->Eval(eV,20);      //Simulation for 20 degress C       
-    aAbsWin[i]=pWiAF->Eval(eV); aIdxWin[i]=1.5787;//pWiIF->Eval(eV);
-    aAbsGap[i]=pGaAF->Eval(eV); aIdxGap[i]=1.0005;//pGaIF->Eval(eV);   
+    aAbsRad[i]=pRaAF->Eval(eV); (isFlatIdx)? aIdxRad[i]=1.292: aIdxRad[i]=pRaIF->Eval(eV,20);     
+    aAbsWin[i]=pWiAF->Eval(eV);              aIdxWin[i]=pWiIF->Eval(eV);
+    aAbsGap[i]=pGaAF->Eval(eV);              aIdxGap[i]=pGaIF->Eval(eV);   
     aQeAll[i] =1;                     //QE for all other materials except for PC must be 1.  
     aAbsMet[i] =0.0001;                aIdxMet[i]=0;                                             //metal ref idx must be 0 in order to reflect photon
                                        aIdxPc [i]=1;           aQePc [i]=pQeF->Eval(eV);         //PC ref idx must be 1 in order to apply photon to QE conversion 
@@ -660,15 +663,14 @@ void AliHMPIDv2::StepManager()
   if((gMC->TrackPid()==50000050||gMC->TrackPid()==50000051)&&gMC->CurrentVolID(copy)==fIdPad){   //photon (Ckov or feedback) hit PC (fIdPad)
     if(gMC->Edep()>0){                                                                           //photon survided QE test i.e. produces electron
       if(IsLostByFresnel()){ gMC->StopTrack(); return;}                                          //photon lost due to fersnel reflection on PC       
-                                                                                        gMC->CurrentVolOffID(5,copy);                                             //current chamber since geomtry tree is Hmp-Hsec-Hgap-Hrow-Hcel-Hpad
+                       gMC->CurrentVolOffID(5,copy);                                             //current chamber since geomtry tree is Hmp-Hsec-Hgap-Hrow-Hcel-Hpad
       Int_t   tid=     gMC->GetStack()->GetCurrentTrackNumber();                                 //take TID
       Int_t   pid=     gMC->TrackPid();                                                          //take PID
       Float_t etot=    gMC->Etot();                                                              //total hpoton energy, [GeV] 
       Double_t x[3];   gMC->TrackPosition(x[0],x[1],x[2]);                                       //take MARS position at entrance to PC
       Float_t xl,yl;   AliHMPIDParam::Instance()->Mars2Lors(copy,x,xl,yl);                       //take LORS position
-       if ( yl < 0  ) Printf("-------------------> SUPER PROBLEM PHOTON>>> Ch: %d, x[]: %f %f %f (MARS)-> xl: %f yl: %f",copy,x[0],x[1],x[2],xl,yl);
       new((*fHits)[fNhits++])AliHMPIDHit(copy,etot,pid,tid,xl,yl,x);                             //HIT for photon, position at P, etot will be set to Q
-      GenFee(etot);                                                                              //generate feedback photons etot is modified in hit ctor to Q of hit
+      if(fDoFeed) GenFee(etot);                                                                  //generate feedback photons etot is modified in hit ctor to Q of hit
     }//photon hit PC and DE >0 
   }//photon hit PC
   
@@ -689,9 +691,8 @@ void AliHMPIDv2::StepManager()
       out[1]=0.5*(out[1]+in[1]);                                                                  //take hit position at the anod plane
       out[2]=0.5*(out[2]+in[2]);                                                                  //>
       Float_t xl,yl;AliHMPIDParam::Instance()->Mars2Lors(copy,out,xl,yl);                         //take LORS position
-       if ( yl < 0  ) Printf("-------------------> SUPER PROBLEM CHARGED>>> Ch: %d, x[]: %f %f %f (MARS)-> xl: %f yl: %f",copy,out[0],out[1],out[2],xl,yl);
       new((*fHits)[fNhits++])AliHMPIDHit(copy,eloss,pid,tid,xl,yl,out);                           //HIT for MIP, position near anod plane, eloss will be set to Q 
-      GenFee(eloss);                                                                              //generate feedback photons 
+      if(fDoFeed) GenFee(eloss);                                                                  //generate feedback photons 
     }else                                                                                         //just going inside
       eloss          += gMC->Edep();                                                              //collect this step eloss 
   }//MIP in GAP
index 942e37e0bf13e392fd4c880064d73dbd104feb2f..6e49d3d6be6e76fa6500c2fb341fda8a49ed531c 100644 (file)
@@ -15,7 +15,7 @@ public:
           HmpConfig(const char*sFileName);
          ~HmpConfig()                    {Info("ctor","");Cleanup();}
          
-  enum EVersOpts  {kNo=101,kVer0,kVer1,kVer2,kTest, kDeclust=301,kSagita,kFeedback,kElNoise,kQe0=400,kQeNorm,kOptics};
+  enum EVersOpts  {kNo=101,kVer0,kVer1,kVer2,kTest, kDeclust=301,kSagita,kFeedback,kElNoise,kQe0=400,kQeNorm,kFlatIdx,kOptics};
   enum EGenTypes  {kGunZ=1,kGun1,kGun7,kBox,kHijing,kHijingPara,kPythia,kHmpLib,kNotUsed=999};
   
   enum EDetectors {kPIPE=1,kITS,kTPC,kTRD,kTOF,kFRAME,kMAG,kACORDE,kHALL,kPHOS,kT0,kFMD,kABSO,kPMD,kDIPO,kEMCAL,kVZERO,kMUON,kZDC,kSHILD};
@@ -89,6 +89,7 @@ void HmpConfig::GuiHmp(TGHorizontalFrame *pMainHF)
     new TGCheckButton(fOptBG,"Wire sagitta      "  ,kSagita);       fOptBG->SetButton(kSagita);
     new TGCheckButton(fOptBG,"Photon feedback   "  ,kFeedback);     fOptBG->SetButton(kFeedback); 
     new TGCheckButton(fOptBG,"Electronic noise  "  ,kElNoise);     // fOptBG->SetButton(kElNoise); 
+    new TGCheckButton(fOptBG,"C6F14 N=1.292     "  ,kFlatIdx);     
     new TGCheckButton(fOptBG,"Plot optics       "  ,kOptics);     
   pHmpGF->AddFrame(fQeBG=new TGButtonGroup(pHmpGF,""));
     new TGRadioButton(fQeBG,"QE=0"                 ,kQe0);       
@@ -114,10 +115,11 @@ void HmpConfig::WriteHmp(FILE *pF)
   if(!fVerBG->GetButton(kNo)->GetState()){
     TString title;
     if(!fOptBG->GetButton(kSagita)  ->GetState())             fprintf(pF,"  AliHMPIDParam::fgIsWireSagita=kFALSE;\n");
-    if(!fOptBG->GetButton(kFeedback)->GetState())             fprintf(pF,"  AliHMPID::DoFeed(kFALSE);\n");
+    if(!fOptBG->GetButton(kFeedback)->GetState())             title+=" NoFeedBack ";
     if( fOptBG->GetButton(kElNoise) ->GetState())             fprintf(pF,"  AliHMPIDDigitizer::DoNoise(kTRUE);\n");
     if( fOptBG->GetButton(kTest)    ->GetState())             title+=" TestBeam ";
     if( fOptBG->GetButton(kOptics)  ->GetState())             title+=" ShowOptics ";
+    if( fOptBG->GetButton(kFlatIdx) ->GetState())             title+=" FlatIdx ";
     if(title.Length()==0) title="Default";
     
     if     (fVerBG->GetButton(kVer0)->GetState())           fprintf(pF,"  new AliHMPIDv0(\"Gel %s\");\n\n",title.Data());    
index 18325b476bef0271bf246a49375438b2dc0296a6..e707debb3ccdc80653dbbe48732d797918daf071 100644 (file)
@@ -9,20 +9,6 @@
 #include <AliHMPIDHit.h>
 #include <AliHMPIDCluster.h>
 
-
-
-TH1F *hHitQdc; TH2F *hHitMap[7];  
-
-
-
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-void BookHits()
-{
-  hHitQdc=new TH1F("HitQdc","Hit Qdc all chamber;QDC",500,0,4000);
-  for(Int_t iCh=0;iCh<7;iCh++)
-    hHitMap[iCh]=new TH2F(Form("HitMap%i",iCh),Form("Ch%i;x_{Hit};y_{Hit}",iCh),1700,-10,160,1700,-10,160);  
-}
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 TObjArray *CreateContainer(const char *classname,TTree *pTree)
 {
@@ -32,14 +18,45 @@ TObjArray *CreateContainer(const char *classname,TTree *pTree)
     pOA->AddAt(pCA,iCh);    
     pTree->SetBranchAddress(Form("HMPID%i",iCh),&pCA);
   }
-  pTree->GetEntry(0);
   return pOA;
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-
+TH1F *hHitQdc; TH2F *hHitMap[7];  
+void Hits(Int_t mode,TTree *pTree=0x0)
+{
+  switch(mode){
+    case 1:
+      hHitQdc=new TH1F("HitQdc","Hit Qdc all chamber;QDC",500,0,4000);
+      for(Int_t iCh=0;iCh<7;iCh++) hHitMap[iCh]=new TH2F(Form("HitMap%i",iCh),Form("Ch%i;x_{Hit};y_{Hit}",iCh),160,0,160,160,0,160);      
+      return;
+    case 2:
+      if(pTree==0) return;
+      TClonesArray *pHits=new TClonesArray("AliHMPIDHit");  pTree->SetBranchAddress("HMPID",&pHits);  
+      for(Int_t iEnt=0;iEnt<pTree->GetEntriesFast();iEnt++){//entries loop
+        pTree->GetEntry(iEnt);
+        for(Int_t iHit=0;iHit<pHits->GetEntriesFast();iHit++){//hits loop
+          AliHMPIDHit *pHit = (AliHMPIDHit*)pHits->UncheckedAt(iHit);
+          hHitMap[pHit->Ch()]->Fill(pHit->LorsX(),pHit->LorsY());
+          hHitQdc->Fill(pHit->Q());
+        }//hits loop      
+      }//entries loop
+      delete pHits;
+      return;
+    case 3:
+      TCanvas *c1=new TCanvas("HitCan","Hits",1280,800); c1->Divide(3,3);
+  
+      for(Int_t iCh=0;iCh<7;iCh++){
+        if(iCh==6) c1->cd(1); if(iCh==5) c1->cd(2);
+        if(iCh==4) c1->cd(4); if(iCh==3) c1->cd(5); if(iCh==2) c1->cd(6);
+                              if(iCh==1) c1->cd(8); if(iCh==0) c1->cd(9);
+        hHitMap[iCh]->Draw();
+      }  
+      c1->cd(3); gPad->SetLogy(); hHitQdc->Draw();
+      return;
+  }
+}//Hits()
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 TH1F *hCluEvt,*hCluChi2,*hCluFlg,*hCluSize;
-
 void Clus(Int_t mode, TTree *pTree=0x0)
 {
   switch(mode){
@@ -51,94 +68,44 @@ void Clus(Int_t mode, TTree *pTree=0x0)
       return;
     case 2:      
       if(pTree==0) return;
-      
-      TObjArray *pLst=CreateContainer("AliHMPIDCluster",pTree); 
+      TObjArray *pLst=CreateContainer("AliHMPIDCluster",pTree); pTree->GetEntry(0);
       for(Int_t iCh=AliHMPIDDigit::kMinCh;iCh<=AliHMPIDDigit::kMaxCh;iCh++){//chambers loop
         TClonesArray *pClus=(TClonesArray *)pLst->UncheckedAt(iCh);
-      
         hCluEvt->Fill(pClus->GetEntriesFast());
         for(Int_t iClu=0;iClu<pClus->GetEntriesFast();iClu++){//clusters loop
           AliHMPIDCluster *pClu=(AliHMPIDCluster*)pClus->UncheckedAt(iClu);
-          hCluFlg->Fill(pClu->Status());
-          hCluChi2->Fill(pClu->Chi2());
-          hCluSize->Fill(pClu->Size());
+          hCluFlg->Fill(pClu->Status());  hCluChi2->Fill(pClu->Chi2());  hCluSize->Fill(pClu->Size());
         }
       }
       delete pLst;           
       return;  
     case 3:
       TCanvas *c1=new TCanvas("CluComCan","Clusters in common",1280,800); c1->Divide(3,3);
-      c1->cd(1); hCluEvt->Draw();  
-      c1->cd(2); hCluChi2->Draw(); 
-      c1->cd(3); hCluFlg->Draw(); 
-      c1->cd(4); hCluSize->Draw(); 
+      c1->cd(1); hCluEvt->Draw();       c1->cd(2); hCluChi2->Draw(); 
+      c1->cd(3); hCluFlg->Draw();       c1->cd(4); hCluSize->Draw(); 
       return;
   }//switch
 }//Clus()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-void FillHits(TTree *pHitTree)
-{
-  if(pHitTree==0) return;
-  TClonesArray *pHitLst=new TClonesArray("AliHMPIDHit");
-  pHitTree->SetBranchAddress("HMPID",&pHitLst);
-  
-  for(Int_t iEnt=0;iEnt<pHitTree->GetEntriesFast();iEnt++){
-    pHitTree->GetEntry(iEnt);
-    for(Int_t iHit=0;iHit<pHitLst->GetEntriesFast();iHit++){
-      AliHMPIDHit *pHit = (AliHMPIDHit*)pHitLst->UncheckedAt(iHit);
-      hHitMap[pHit->Ch()]->Fill(pHit->LorsX(),pHit->LorsY());
-      hHitQdc->Fill(pHit->Q());
-    }      
-  }
-  delete pHitLst;
-}    
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-void PlotHits()
-{
-  TCanvas *pHitCan=new TCanvas("HitCan","Hits",1280,800); pHitCan->Divide(3,3);
-  
-  for(Int_t iCh=0;iCh<7;iCh++){
-    if(iCh==6) pHitCan->cd(1); if(iCh==5) pHitCan->cd(2);
-    if(iCh==4) pHitCan->cd(4); if(iCh==3) pHitCan->cd(5); if(iCh==2) pHitCan->cd(6);
-                               if(iCh==1) pHitCan->cd(8); if(iCh==0) pHitCan->cd(9);
-    hHitMap[iCh]->Draw();
-  }  
-  pHitCan->cd(3); gPad->SetLogy(); hHitQdc->Draw();
-}
-
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
 void Hqa()
 {
 
   TFile *fh=0; if(gSystem->IsFileInIncludePath("HMPID.Hits.root"))      fh=TFile::Open("HMPID.Hits.root"     ,"read");if(fh->IsZombie()) fh=0;
   TFile *fd=0; if(gSystem->IsFileInIncludePath("HMPID.Digits.root"))    fd=TFile::Open("HMPID.Digits.root"   ,"read");if(fd->IsZombie()) fd=0;
   TFile *fc=0; if(gSystem->IsFileInIncludePath("HMPID.RecPoints.root")) fc=TFile::Open("HMPID.RecPoints.root","read");if(fc->IsZombie()) fc=0;
-  
-  
   if(fh==0 && fd==0 && fc==0){Printf("Nothing to do!"); return;}
-  
-  
-  if(fh) BookHits();
-  if(fc) Clus(1); //book
-  
+  if(fh) Hits(1); if(fc) Clus(1);  //book
   Int_t iEvt=0;
   while(1){
     TTree *th=0; if(fh) th=(TTree*)fh->Get(Form("Event%i/TreeH",iEvt));
     TTree *td=0; if(fd) td=(TTree*)fd->Get(Form("Event%i/TreeD",iEvt));
     TTree *tc=0; if(fc) tc=(TTree*)fc->Get(Form("Event%i/TreeR",iEvt));
-    
-    FillHits(th);
-    Clus(2,tc);
+    Hits(2,th);   Clus(2,tc); //fill
     if(th==0 && td==0 && tc==0) break;
     iEvt++;
     Printf("Event %i processed",iEvt);
   }
-  
-  if(fh) PlotHits();
-  if(fc) Clus(3); //plot
+  if(fh) Hits(3);  if(fc) Clus(3); //plot
 }
 
 /*