Changes according to new ESD structure, as well as the restored geometry.root files...
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 22 Jun 2007 15:47:01 +0000 (15:47 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 22 Jun 2007 15:47:01 +0000 (15:47 +0000)
HMPID/AliHMPIDParam.cxx
HMPID/AliHMPIDQaEsd.C
HMPID/AliHMPIDv2.cxx
HMPID/HESDfromKin.C
HMPID/Hconfig.C
HMPID/Hdisp.C
HMPID/Hqa.C

index f6ff55f..268c350 100644 (file)
@@ -53,7 +53,8 @@ AliHMPIDParam::AliHMPIDParam():TNamed("HmpidParam","default version")
 
 if(!gGeoManager) 
 {
-TGeoManager::Import("misaligned_geometry.root");
+//TGeoManager::Import("misaligned_geometry.root");                                                        //clm: it was a temporary solution
+  TGeoManager::Import("geometry.root");
 if(!gGeoManager) AliFatal("!!!!!!No geometry loaded!!!!!!!");
 }
 
index 492c6f5..5707a9b 100644 (file)
@@ -80,9 +80,10 @@ void AliHMPIDQaEsd::ConnectInputData(const Option_t*)
     fESD = (AliESD*)(*address);
   } else {
     fESD = new AliESD();
-    SetBranchAddress(0, "ESD", &fESD);
-    fChain->SetBranchStatus("*", 1);
-    fChain->SetBranchStatus("fTracks.*", 1);
+    fESD->ReadFromTree(fChain);                                                                   //clm: new ESD access works for local, need to test it for PROOF!
+    //SetBranchAddress(0, "esdTree", &fESD);
+    //fChain->SetBranchStatus("*", 1);
+    //fChain->SetBranchStatus("fTracks.*", 1);
   }
 }//ConnectInputData()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -176,11 +177,19 @@ void AliHMPIDQaEsd::Terminate(Option_t *)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void qa(Int_t mode=0)
 {
+  
+  /*
+  AliAODHandler* aodHandler   = new AliAODHandler();
+    mgr->SetEventHandler(aodHandler);
+  */
+  
   gBenchmark->Start("HMPID QA");
   
   TChain* chain =new TChain("esdTree");  
-  AliAnalysisManager *mgr=new AliAnalysisManager("FunnyName");
-  
+  AliAnalysisManager *mgr=new AliAnalysisManager("FunnyName");                                                   //clm: 
+  //AliAODHandler* aodHandler   = new AliAODHandler();
+  //mgr->SetEventHandler(aodHandler);
+    
   AliAnalysisTask *qa=new AliHMPIDQaEsd();
   qa->ConnectInput (0,mgr->CreateContainer("EsdChain",TChain::Class()   ,AliAnalysisManager::kInputContainer));
   qa->ConnectOutput(0,mgr->CreateContainer("HistLst",TObjArray::Class(),AliAnalysisManager::kOutputContainer));
index c524584..683bb10 100644 (file)
@@ -718,7 +718,8 @@ void AliHMPIDv2::TestGeom()
 //
 // Test method to check geometry
 //
-  TGeoManager::Import("misaligned_geometry.root");
+  //TGeoManager::Import("misaligned_geometry.root");
+  TGeoManager::Import("geometry.root");
   for(Int_t ch=AliHMPIDParam::kMinCh;ch<=AliHMPIDParam::kMaxCh;ch++)
     TestPoint(ch,0,0);
 }//TestPoint()
index d5ee5ab..6591c73 100644 (file)
@@ -3,7 +3,7 @@ Int_t gEvt=0; Int_t gMaxEvt=0;
 TObjArray *pNmean;
 TTree *gEsdTr;
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void HESDfromKin(const char *name)
+void HESDfromKin(const char *name="default")
 {//simulate ESD from kinematics
 
   if(gSystem->IsFileInIncludePath("galice.root")){// tries to open session
@@ -18,8 +18,10 @@ void HESDfromKin(const char *name)
     AliESD *pEsd = new AliESD();   
     TFile *pEsdFl=TFile::Open("AliESDs.root","recreate"); 
     gEsdTr=new TTree("esdTree","Sim ESD from kinematics"); 
-    gEsdTr->Branch("ESD", &pEsd);
-         
+    pEsd->CreateStdContent();    pEsd->WriteToTree(gEsdTr);  //clm: new ESD write schema: see Task Force meeting 20th June, 2007
+    gEsdTr->GetUserInfo()->Add(pEsd);                        //clm: TList has to be created for ReadFromTree method -- this was not needed by the old ESD
+       
   }  else return;  
 
   OpenCalib();
@@ -27,6 +29,8 @@ void HESDfromKin(const char *name)
   TString ttl=name;
   Bool_t htaCheck=ttl.Contains("HTA");
   if(!htaCheck) SimEsd(pHL,pEsd); else SimEsdHidden(pHL,pEsd);
+  
+  pEsdFl->cd();
   pEsdFl->Write();pEsdFl->Close();        
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -49,7 +53,7 @@ void SimEsd(AliLoader *pHL,AliESD *pEsd)
       TParticle *pTrack=pStack->Particle(i); 
       mtid=pTrack->GetFirstMother();
       if(mtid>=0) continue; // only primaries
-      AliESDtrack trk(pTrack);
+      AliESDtrack trk(pTrack); 
       pEsd->AddTrack(&trk);
       AliHMPIDTracker::Recon(pEsd,pH->CluLst(),pNmean);
     }// track loop
index b5e70f1..4289dd2 100644 (file)
@@ -1,3 +1,9 @@
+//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
+//Change log:  21st June 2007 by Levente Molnar
+//             Detector description upgrade: ITS,ToF,Absorber, Dipole, V0, Emcal
+//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
+
+
 #include <TPDGCode.h>
 
 Bool_t gGun1      =kFALSE;
@@ -434,36 +440,45 @@ void HmpConfig::DetRemSlot(Int_t id)
 void HmpConfig::WriteDet(FILE *pF)
 {
 //CORE detectors                  
-  if(fDetBG->GetButton(kPIPE )->GetState()) fprintf(pF,"\n  new AliPIPEv0(\"PIPE\",\"Beam Pipe\");\n");
-  if(fDetBG->GetButton(kSHILD)->GetState()) fprintf(pF,"\n  new AliSHILv2(\"SHIL\",\"Shielding Version 2\");\n");  
+  if(fDetBG->GetButton(kPIPE )->GetState()) fprintf(pF,"\n  new AliPIPEv3(\"PIPE\",\"Beam Pipe\");\n");
+  if(fDetBG->GetButton(kSHILD)->GetState()) fprintf(pF,"\n  new AliSHILv3(\"SHIL\",\"Shielding Version 2\");\n");  
   if(fDetBG->GetButton(kITS  )->GetState()){
-    fprintf(pF,"\n  AliITSvPPRasymmFMD *pIts =new AliITSvPPRasymmFMD(\"ITS\",\"ITS PPR detailed version\");\n");
-    fprintf(pF,"  pIts->SetMinorVersion(2); pIts->SetReadDet(kFALSE);\n");
-    fprintf(pF,"  pIts->SetThicknessDet1(200.); pIts->SetThicknessDet2(200.);\n");
-    fprintf(pF,"  pIts->SetThicknessChip1(150.); pIts->SetThicknessChip2(150.);\n");
-    fprintf(pF,"  pIts->SetRails(0); pIts->SetCoolingFluid(1);\n");
-    fprintf(pF,"  pIts->SetEUCLID(0);\n");
+    fprintf(pF,"\n AliITSvPPRasymmFMD *ITS  = new AliITSvPPRasymmFMD(\"ITS\",\"ITS PPR detailed version with asymmetric services\");\n");
+    fprintf(pF,"\n  ITS->SetMinorVersion(2);\n");  
+    fprintf(pF,"\n  ITS->SetReadDet(kFALSE);\n");      
+    fprintf(pF,"\n  ITS->SetThicknessDet1(200.);\n"); 
+    fprintf(pF,"\n  ITS->SetThicknessDet2(200.); \n");
+    fprintf(pF,"\n  ITS->SetThicknessChip1(150.);\n");
+    fprintf(pF,"\n  ITS->SetThicknessChip2(150.);\n");
+    fprintf(pF,"\n  ITS->SetRails(0);\n");     
+    fprintf(pF,"\n  ITS->SetCoolingFluid(1);\n");
+    fprintf(pF,"\n  ITS->SetEUCLID(0);\n");
   }  
+  
   if(fDetBG->GetButton(kTPC  )->GetState())  fprintf(pF,"\n  new AliTPCv2(\"TPC\",\"Default\");\n");
   if(fDetBG->GetButton(kFRAME)->GetState())  fprintf(pF,"\n  AliFRAMEv2 *pFrame=new AliFRAMEv2(\"FRAME\",\"Space Frame\"); pFrame->SetHoles(1);\n");
   if(fDetBG->GetButton(kTRD  )->GetState())  fprintf(pF,"\n  AliTRD *pTrd=new AliTRDv1(\"TRD\",\"TRD slow simulator\");\n");  
-  if(fDetBG->GetButton(kTOF  )->GetState()) fprintf(pF,"\n  new AliTOFv4T0(\"TOF\", \"normal TOF\");\n");
+  if(fDetBG->GetButton(kTOF  )->GetState())  {
+    fprintf(pF,"\n  AliTOF *TOF = new AliTOFv6T0(\"TOF\", \"normal TOF\");\n");
+    fprintf(pF,"\n  Int_t TOFSectors[18]={-1,0,0,-1,-1,-1,0,0,-1,0,0,0,0,-1,-1,0,0,0};\n");
+    fprintf(pF,"\n  TOF->SetTOFSectors(TOFSectors);\n");
+  }
 //central detectors  behind HMPID
   if(fDetBG->GetButton(kMAG  )->GetState()) fprintf(pF,"\n  new AliMAG(\"MAG\",\"Magnet\");\n");  
   if(fDetBG->GetButton(kHALL )->GetState()) fprintf(pF,"\n  new AliHALL(\"HALL\",\"Alice Hall\");\n");
 //forward detectors  
-  if(fDetBG->GetButton(kFMD  )->GetState()) fprintf(pF,"\n  new AliFMDv1(\"FMD\",\"normal FMD\");\n");
-  if(fDetBG->GetButton(kABSO )->GetState()) fprintf(pF,"\n  new AliABSOv0(\"ABSO\",\"Muon absorber\");\n");
-  if(fDetBG->GetButton(kDIPO )->GetState()) fprintf(pF,"\n  new AliDIPOv2(\"DIPO\",\"Dipole version 2\");\n");
-  if(fDetBG->GetButton(kMUON )->GetState()) fprintf(pF,"\n  new AliMUONv1(\"MUON\",\"default\");\n");
-  if(fDetBG->GetButton(kPMD  )->GetState()) fprintf(pF,"\n  new AliPMDv1(\"PMD\",\"normal PMD\");\n");
-  if(fDetBG->GetButton(kT0)->GetState()) fprintf(pF,"\n  new AliT0v1(\"T0\",\"T0 Detector\");\n");
-  if(fDetBG->GetButton(kVZERO)->GetState()) fprintf(pF,"\n  new AliVZEROv2(\"VZERO\",\"normal VZERO\");\n");
-  if(fDetBG->GetButton(kZDC  )->GetState()) fprintf(pF,"\n  new AliZDCv2(\"ZDC\",\"normal ZDC\");\n");
+  if(fDetBG->GetButton(kFMD  )->GetState()) fprintf(pF,"\n  AliFMD *FMD = new AliFMDv1(\"FMD\",\"normal FMD\");\n");
+  if(fDetBG->GetButton(kABSO )->GetState()) fprintf(pF,"\n  AliABSO *ABSO = new AliABSOv3(\"ABSO\",\"Muon absorber\");\n");
+  if(fDetBG->GetButton(kDIPO )->GetState()) fprintf(pF,"\n  AliDIPO *DIPO = new AliDIPOv3(\"DIPO\",\"Dipole version 3\");\n");
+  if(fDetBG->GetButton(kMUON )->GetState()) fprintf(pF,"\n  AliMUON *MUON = new AliMUONv1(\"MUON\",\"default\");\n");
+  if(fDetBG->GetButton(kPMD  )->GetState()) fprintf(pF,"\n  AliPMD *PMD = new AliPMDv1(\"PMD\",\"normal PMD\");\n");
+  if(fDetBG->GetButton(kT0)->GetState())    fprintf(pF,"\n  AliT0 *T0 = new AliT0v1(\"T0\",\"T0 Detector\");\n");
+  if(fDetBG->GetButton(kVZERO)->GetState()) fprintf(pF,"\n  AliVZERO *VZERO = new AliVZEROv7(\"VZERO\",\"normal VZERO\");\n");
+  if(fDetBG->GetButton(kZDC  )->GetState()) fprintf(pF,"\n  AliZDC *ZDC = new AliZDCv2(\"ZDC\",\"normal ZDC\");\n");
 //different phase space detectors  
-  if(fDetBG->GetButton(kPHOS )->GetState()) fprintf(pF,"\n  new AliPHOSv1(\"PHOS\",\"IHEP\");\n");
-  if(fDetBG->GetButton(kEMCAL)->GetState()) fprintf(pF,"\n  new AliEMCALv1(\"EMCAL\",\"G56_2_55_19_104_14\");\n");
-  if(fDetBG->GetButton(kACORDE  )->GetState()) fprintf(pF,"\n  new AliACORDEv0(\"ACORDE\",\"normal ACORDE\");\n");
+  if(fDetBG->GetButton(kPHOS )->GetState()) fprintf(pF,"\n  AliPHOS *PHOS = new AliPHOSv1(\"PHOS\",\"IHEP\");\n");
+  if(fDetBG->GetButton(kEMCAL)->GetState()) fprintf(pF,"\n  AliEMCAL *EMCAL = new AliEMCALv2(\"EMCAL\",\"SHISH_77_TRD1_2X2_FINAL_110DEG\");\n");
+  if(fDetBG->GetButton(kACORDE  )->GetState()) fprintf(pF,"\n  AliACORDE *ACORDE = new AliACORDEv0(\"ACORDE\",\"normal ACORDE\");\n");
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void HmpConfig::GuiBatch(TGHorizontalFrame *pMainF)
index a3e8249..3d99c9e 100644 (file)
@@ -21,6 +21,8 @@
 #include "AliHMPIDRecon.h"
 #include "AliHMPIDParam.h"
 #include "AliHMPIDCluster.h"
+#include "AliTracker.h"
+
 #include <TChain.h>
 
 #endif
@@ -32,6 +34,7 @@ TFile *fDigFile; TTree *fDigTree; TObjArray    *fDigLst; TPolyMarker *fRenDig[7]
 TFile *fCluFile; TTree *fCluTree; TObjArray    *fCluLst; TPolyMarker *fRenClu[7];    
 TFile *fEsdFile; TTree *fEsdTree;  AliESD      *fEsd;    TPolyMarker *fRenTxC[7]; TPolyMarker *fRenRin[7];  
 TFile *fCosFile; TTree *fCosTree;
+AliRunLoader *gAL=0; 
 
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void CreateContainers()
@@ -186,13 +189,24 @@ void RenderHit(TClonesArray *pHitLst)
   }//hits loop for this entry
 }//RenderHits()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void RenderClu(TObjArray *pClus,TPolyMarker **pMark)
+void RenderDig(TObjArray *pDigLst)
+{//used by ReadEvent() and SimulateEvent() to render digs to Tbox structures, one per chamber
+  for(Int_t iCh=0;iCh<=6;iCh++){                                    //chambers loop   
+    TClonesArray *pDigCham=(TClonesArray*)pDigLst->At(iCh);         //get digs list for this chamber
+    for(Int_t iDig=0;iDig<pDigCham->GetEntries();iDig++){            //digs loop
+      AliHMPIDDigit *pDig = (AliHMPIDDigit*)pDigCham->At(iDig); Float_t x=pDig->LorsX(); Float_t y=pDig->LorsY();    //get current hit        
+      fRenDig[iCh]->SetNextPoint(x,y);
+    }
+  }//hits loop for this entry
+}//RenderHits()
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void RenderClu(TObjArray *pClus)
 {//used by ReadEvent() and SimulateEvent() to render clusters to polymarker structures, one per chamber
   for(Int_t iCh=0;iCh<=6;iCh++){                                     //chambers loop   
     TClonesArray *pClusCham=(TClonesArray*)pClus->At(iCh);           //get clusters list for this chamber
     for(Int_t iClu=0;iClu<pClusCham->GetEntries();iClu++){           //clusters loop
       AliHMPIDCluster *pClu = (AliHMPIDCluster*)pClusCham->At(iClu); //get current cluster        
-      pMark[iCh]->SetNextPoint(pClu->X(),pClu->Y()); 
+      fRenClu[iCh]->SetNextPoint(pClu->X(),pClu->Y()); 
     }//switch hit PID      
   }//hits loop for this entry
 }//RenderClus()
@@ -204,7 +218,7 @@ void RenderEsd(AliESD *pEsd)
     AliESDtrack *pTrk=pEsd->GetTrack(iTrk);    Int_t ch=pTrk->GetHMPIDcluIdx(); //get track and chamber intersected by it
     if(ch<0) continue;                                                          //this track does not intersect any chamber
     Float_t thRa,phRa,xRa,yRa; pTrk->GetHMPIDtrk(xRa,yRa,thRa,phRa);            //get info on current track
-    ch/=1000000;                                                                //actual chamber number 
+    ch/=1000000;                            
     Float_t xPc=0,yPc=0; AliHMPIDTracker::IntTrkCha(pTrk,xPc,yPc);              //find again intersection of track with PC--> it is not stored in ESD!
     fRenTxC[ch]->SetNextPoint(xPc,yPc);                                            //add this intersection point
     Float_t ckov=pTrk->GetHMPIDsignal();                                        //get ckov angle stored for this track  
@@ -303,12 +317,19 @@ void ReadEvent()
       RenderHit(fHitLst);   
     }//prim loop
   }//if hits file
-  
+
+  if(fDigFile){ 
+    if(fDigTree) delete fDigTree;   fDigTree=(TTree*)fDigFile->Get(Form("Event%i/TreeD",fEvt));
+    for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) fDigTree->SetBranchAddress(Form("HMPID%i",iCh),&(*fDigLst)[iCh]);      
+    fDigTree->GetEntry(0);                              
+    RenderDig(fDigLst);   
+  }//if digs file
+    
   if(fCluFile){ 
     if(fCluTree) delete fCluTree; fCluTree=(TTree*)fCluFile->Get(Form("Event%i/TreeR",fEvt));
     for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) fCluTree->SetBranchAddress(Form("HMPID%i",iCh),&(*fCluLst)[iCh]);      
     fCluTree->GetEntry(0);
-    RenderClu(fCluLst,fRenClu);   
+    RenderClu(fCluLst);   
   }//if clus file
   
   if(fEsdFile){//if ESD file open
@@ -324,13 +345,13 @@ void SimulateEvent()
 
   SimulateEsd(fEsd);
   SimulateHits(fEsd,fHitLst);
-                 AliHMPIDv2::Hit2Sdi(fHitLst,fSdiLst);                               
+                 AliHMPIDv1::Hit2Sdi(fHitLst,fSdiLst);                               
           AliHMPIDDigitizer::Sdi2Dig(fSdiLst,fDigLst);     
       AliHMPIDReconstructor::Dig2Clu(fDigLst,fCluLst);
             AliHMPIDTracker::Recon(fEsd,fCluLst,(TObjArray*)pNmeanEnt->GetObject());
             
   RenderHit(fHitLst);
-  RenderClu(fCluLst,fRenClu);
+  RenderClu(fCluLst);
   RenderEsd(fEsd);            
 }//SimulateEvent()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -359,16 +380,29 @@ void Hdisp()
   }
   
   if(gSystem->IsFileInIncludePath("HMPID.Digits.root")){// tries to open clusters
-    fDigFile=TFile::Open("HMPID.Digits.root");  fNevt=fDigFile->GetNkeys(); fType=1;  title+=Form(" DIGITS-%i ",fNevt);
-  }
+     fDigFile=TFile::Open("HMPID.Digits.root");  fNevt=fDigFile->GetNkeys(); fType=1;  title+=Form(" DIGITS-%i ",fNevt);
+   }
   
   if(gSystem->IsFileInIncludePath("HMPID.RecPoints.root")){// tries to open clusters
     fCluFile=TFile::Open("HMPID.RecPoints.root");  fNevt=fCluFile->GetNkeys(); fType=1;  title+=Form(" CLUSTERS-%i ",fNevt);
-  }
+   }
   
   if(gSystem->IsFileInIncludePath("AliESDs.root")){     
-    fEsdFile=TFile::Open("AliESDs.root"); fEsdTree=(TTree*)fEsdFile->Get("esdTree");  fNevt=fEsdTree->GetEntries(); fType=1;  title+=Form(" ESD-%i ",fNevt);
-                                          fEsdTree->SetBranchAddress("ESD", &fEsd);    
+    fEsdFile=TFile::Open("AliESDs.root"); 
+    fEsdTree=(TTree*)fEsdFile->Get("esdTree"); 
+    fEsd->ReadFromTree(fEsdTree); fEsd->GetStdContent();                       //clm: new ESD schema: see Task Force meeting 20th June, 2007
+    fNevt=fEsdTree->GetEntries(); fType=1;  title+=Form(" ESD-%i ",fNevt);
+    
+    //clm: we need to set the magnetic field  
+    if(gSystem->IsFileInIncludePath("galice.root")){
+    if(gAlice) delete gAlice;                       
+    gAL=AliRunLoader::Open();                       
+    gAL->LoadgAlice();           
+    AliHMPIDTracker::SetFieldMap(gAL->GetAliRun()->Field(),kTRUE);                         
+   }else{
+          Printf("=============== NO galice file! Magnetic field for ESD tracking is: %f ===============",AliTracker::GetBz());
+     }  
+      
   }
 
   if(gSystem->IsFileInIncludePath("cosmic.root")){                          //clm: Check if cosmic file is in the folder
index dc83cc9..20a64fa 100644 (file)
@@ -1,5 +1,6 @@
 #include <TSystem.h>
 #include <TFile.h>
+#include <TStyle.h>
 #include <TTree.h>
 #include <TClonesArray.h>
 #include <TObjArray.h>
@@ -28,7 +29,7 @@ void Hits(Int_t mode,TTree *pTree=0x0)
     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;
+      break;
     case 2:
       if(pTree==0) return;
       TClonesArray *pHits=new TClonesArray("AliHMPIDHit");  pTree->SetBranchAddress("HMPID",&pHits);  
@@ -41,7 +42,7 @@ void Hits(Int_t mode,TTree *pTree=0x0)
         }//hits loop      
       }//entries loop
       delete pHits;
-      return;
+      break;
     case 3:
       TCanvas *c1=new TCanvas("HitCan","Hits",1280,800); c1->Divide(3,3);
   
@@ -49,10 +50,11 @@ void Hits(Int_t mode,TTree *pTree=0x0)
         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();
+        gStyle->SetPalette(1);      
+        hHitMap[iCh]->Draw("colz");
       }  
-      c1->cd(3); gPad->SetLogy(); hHitQdc->Draw();
-      return;
+      c1->cd(3); gPad->SetLogy(); hHitQdc->SetFillColor(5);hHitQdc->Draw();
+      break;
   }
 }//Hits()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -61,11 +63,11 @@ void Clus(Int_t mode, TTree *pTree=0x0)
 {
   switch(mode){
     case 1:
-      hCluEvt=new TH1F("CluPerEvt","# clusters per event",11,-0.5,10.5);
+      hCluEvt=new TH1F("CluPerEvt","# clusters per event",21,-0.5,20.5);
       hCluChi2  =new TH1F("CluChi2"  ,"Chi2 "               ,1000,0,100);
       hCluFlg   =new TH1F("CluFlg"   ,"Cluster flag"        ,14,-1.5,12.5);                       hCluFlg->SetFillColor(5);
       hCluSize  =new TH1F("CluSize"  ,"Raw cluster size    ",100,0,100);
-      return;
+      break;
     case 2:      
       if(pTree==0) return;
       TObjArray *pLst=CreateContainer("AliHMPIDCluster",pTree); pTree->GetEntry(0);
@@ -78,12 +80,14 @@ void Clus(Int_t mode, TTree *pTree=0x0)
         }
       }
       delete pLst;           
-      return;  
+      break;
     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(); 
-      return;
+      c1->cd(1); hCluEvt->->SetFillColor(5);    hCluEvt->Draw();
+      c1->cd(2); hCluChi2->SetFillColor(5);     hCluChi2->Draw(); 
+      c1->cd(3); hCluFlg->SetFillColor(5);      hCluFlg->Draw(); 
+      c1->cd(4); hCluSize->SetFillColor(5);     hCluSize->Draw(); 
+      break;
   }//switch
 }//Clus()
 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -92,10 +96,10 @@ void Digs(Int_t mode, TTree *pTree=0x0)
 {
   switch(mode){
     case 1:
-      hDigPcEvt=new TH1F("OccPerEvt","PC occupancy per event",156,-1,77);
-      hDigChEvt=new TH1F("OccPerEvt","Chamber occupancy per event",32,-1,7);
+      hDigPcEvt=new TH1F("hDigPcEvt","PC occupancy per event",156,-1,77);
+      hDigChEvt=new TH1F("hDigChEvt","Chamber occupancy per event",32,-1,7);
       hDigQ  =new TH1F("Q        ","Q                     ",3000,0,3000);
-      return;
+      break;
     case 2:
       if(pTree==0) return;
       TObjArray *pLst=CreateContainer("AliHMPIDDigit",pTree); pTree->GetEntry(0);
@@ -109,11 +113,11 @@ void Digs(Int_t mode, TTree *pTree=0x0)
         }
       }
       delete pLst;
-      return;
+      break;
     case 3:
       TCanvas *c1=new TCanvas("DigQa","Digit Check",1280,800); c1->Divide(2,2);
       c1->cd(1); hDigPcEvt->Draw();       c1->cd(2); hDigQ->Draw(); c1->cd(3); hDigChEvt->Draw();
-      return;
+      break;
   }//switch
 }//Dig()
 
@@ -136,105 +140,8 @@ void Hqa()
     iEvt++;
     Printf("Event %i processed",iEvt);
   }
- // if(fh) Hits(3);  if(fc) Clus(3); 
-
-if(fd) Digs(3);//plot
-}
-
-/*
-
-void BlahQA()
-{
-  TFile *pFile = new TFile("Hqa.root","recreate");
-  AliHMPIDCluster::DoCorrSin(kFALSE);
-  AliHMPIDDigit::fSigmas=4;
-  Int_t nEvts=10000;
-  TLegend *lQ=new TLegend(0.5,0.5,0.9,0.9);
-
-  TH1F *hQ7eV  =new TH1F("hQ7eV"  ,"" ,300,-50,2000);     hQ7eV  ->SetLineColor(kRed);      lQ->AddEntry(hQ7eV  ,"Ckov 7 eV");  hQ7eV->SetStats(0);
-  TH1F *hQ200eV=new TH1F("hQ200eV","" ,300,-50,2000);     hQ200eV->SetLineColor(kBlack);    lQ->AddEntry(hQ200eV,"mip 200 eV");
-  TH1F *hQ500eV=new TH1F("hQ500eV","" ,300,-50,2000);     hQ500eV->SetLineColor(kCyan);     lQ->AddEntry(hQ500eV,"mip 500 eV");
-  TH1F *hQ900eV=new TH1F("hQ900eV","" ,300,-50,2000);     hQ900eV->SetLineColor(kGreen);    lQ->AddEntry(hQ900eV,"mip 900 eV");
-  
-  
-  gStyle->SetOptStat(10);
-  TH2F *pCluMapSi1  =new TH2F("cluMapSi1","Size 1 map"       ,1700,-10,160,1700,-10,160);
-  TH2F *pCluMapLo0  =new TH2F("cluMNoLo0","Loc Max 0 map"    ,1700,-10,160,1700,-10,160);     
-  TH2F *pCluMapLo1  =new TH2F("cluMapLo1","Loc Max 1 map"    ,1700,-10,160,1700,-10,160);        
-  TH2F *pCluMapUnf  =new TH2F("cluMapUnf","Unfolded map"     ,1700,-10,160,1700,-10,160);         
-  TH2F *pCluMapEdg  =new TH2F("cluMapEdg","On edge map"      ,1700,-10,160,1700,-10,160);         
-  TH2F *pCluMapCoG  =new TH2F("cluMapCoG","CoG  map"         ,1700,-10,160,1700,-10,160);            
-  TH2F *pCluMapEmp  =new TH2F("cluMapEmp","undefined-empty"  ,1700,-10,160,1700,-10,160);      
-  TH2F *pCluMapNoLoc=new TH2F("cluMapNoLoc","no loc maxima"  ,1700,-10,160,1700,-10,160);      
-  TH2F *pCluMapAbn  =new TH2F("cluMapAbn","abnormal fit"     ,1700,-10,160,1700,-10,160);      
-  TH2F *pCluMapNot  =new TH2F("cluMapNot","Raw Clusters"     ,1700,-10,160,1700,-10,160);      
-  TH2F *pCluMapMax  =new TH2F("cluMapMax","N. locs excceds"  ,1700,-10,160,1700,-10,160);      
-
-  TH1F *hHitCluDifX = new TH1F("hHitCluDifX" ,";entries;x_{Hit}-x_{Clu} [cm]"   ,1000,-1,1);          hHitCluDifX->Sumw2();    hHitCluDifX->SetFillColor(kYellow);
-//  TH2F *hHitCluDifXv= new TH2F("hHitCluDifXv",";x_{Hit};x_{Hit}-x_{Clu} [cm]"   ,500,-0.5,0.5,1000,-0.2,0.2);hHitCluDifXv->Sumw2();
-  TProfile *hHitCluDifXv= new TProfile("hHitCluDifXv",";x_{Hit};x_{Hit}-x_{Clu} [cm]"   ,500,-0.5,0.5);
-  TH1F *hHitCluDifY = new TH1F("hHitCluDifY" ,";entries;y_{Hit}-y_{Clu} [cm]"   ,1000,-1,1);          hHitCluDifY->Sumw2();    hHitCluDifY->SetFillColor(kYellow);
-  TH2F *hHitCluDifXY= new TH2F("hHitCluDifXY",";x_{Hit}-x_{Clu};y_{Hit}-y_{Clu}",1000,-1,1,1000,-1,1);hHitCluDifXY->Sumw2();  
-  TH1F *hHitCluDifQ = new TH1F("hHitCluDifQ" ,";entries;(Q_{Clu}-Q_{Hit})/Q_{Hit}" ,200 ,-200,200);   hHitCluDifQ->Sumw2();    hHitCluDifQ->SetFillColor(kYellow);
-  
-  Float_t e200=200e-9,e500=500e-9,e900=900e-9,e7=7e-9;//predefined  Eloss
-  
-  AliHMPIDHit hit(0,0,kProton,0,0,0);
-  for(int i=0;i<5000;i++){
-    hQ200eV->Fill(hit.QdcTot(e200));  hQ500eV->Fill(hit.QdcTot(e500));   hQ900eV->Fill(hit.QdcTot(e900));  hQ7eV->Fill(hit.QdcTot(e7));
-  }  
-  TClonesArray hits("AliHMPIDHit");  TClonesArray sdigs("AliHMPIDDigit");
-  TObjArray digs(7); for(Int_t i=0;i<7;i++) digs.AddAt(new TClonesArray("AliHMPIDDigit"),i);
-  TObjArray clus(7); for(Int_t i=0;i<7;i++) clus.AddAt(new TClonesArray("AliHMPIDCluster"),i);
-  
-    
-  for(Int_t iEvt=0;iEvt<nEvts;iEvt++){//events loop
-    if(iEvt%50==0)Printf("============> iEvt = %d ",iEvt);
-    
-    Int_t ch,pid; Float_t e,hitx,hity,hitq;
-//    Int_t nHits=(type==999)?1:40;
-    Int_t nHits=1;
-    for(Int_t iHit=0;iHit<nHits;iHit++){//hits loop for the current event
-      switch(iHit){
-        case 0:  ch=0;pid=kProton;e=e200;
-                 hitx=AliHMPIDParam::SizePadX()*(6+gRandom->Rndm());
-                 hity=AliHMPIDParam::SizePadY()*(6+gRandom->Rndm());break; //mip ramdomly distributed in one pad
-        case 1:  ch=0;pid=kProton;e=e200;hitx=0.4;hity=0.42;break; //mip in left-hand bottom coner of chamber 0
-        case 2:  ch=0;pid=kProton;e=e200;hitx=0.4;hity=30  ;break; //mip on left edge of chamber 0
-        case 3:  ch=0;pid=kProton;e=e200;hitx=40; hity=0.42;break; //mip on bottom edge of chamber 0
-        default: ch=gRandom->Rndm()*6; pid=(gRandom->Rndm()>0.9)? kProton:50000050;
-                  if(pid==kProton) 
-                    e=gRandom->Rndm()*900e-9; 
-                  else
-                    e=5.5e-9+3e-9*gRandom->Rndm();
-                  hitx=gRandom->Rndm()*AliHMPIDParam::SizeAllX(); hity=gRandom->Rndm()*AliHMPIDParam::SizeAllY();break; //random hit
-      }
-      new(hits[iHit]) AliHMPIDHit(ch,e,pid,iHit,hitx,hity);                          
-      hitq=e;
-    }//hits loop
-    
-            case AliHMPIDCluster::kNoLoc: pCluMapNoLoc->Fill(clux,cluy);break;
-            case AliHMPIDCluster::kNoLoc: pCluMapNoLoc->Fill(clux,cluy);break;
-            case AliHMPIDCluster::kAbn:   pCluMapAbn->Fill(clux,cluy);  break;
-            case AliHMPIDCluster::kNot:   pCluMapNot->Fill(clux,cluy);  break;
-            default:     pCluMapEmp->Fill(clux,cluy); break;           
-        }
-        
-        hHitCluDifX->Fill(hitx-clux); hHitCluDifY->Fill(hity-cluy); hHitCluDifXY->Fill(hitx-clux,hity-cluy); hHitCluDifQ->Fill(100*(cluq-hitq)/hitq);
-        // distorsion due to feedback photons
-        Int_t pc,px,py;
-        AliHMPIDParam::Lors2Pad(hitx,hity,pc,px,py);
-        Float_t padCenterX = AliHMPIDParam::LorsX(pc,px);
-        if(pClu->Size()>1)hHitCluDifXv->Fill(hitx-padCenterX,(hitx-clux));        
-        //
-      }//clusters loop
-    }//chambers loop
-      
-    hits.Delete();  sdigs.Delete();  for(int i = 0;i<7;i++){((TClonesArray*)digs.At(i))->Delete();((TClonesArray*)clus.At(i))->Delete();}
-  }//events loop      
+  if(fh) Hits(3);
+  if(fc) Clus(3); 
+  if(fd) Digs(3);//plot
 }
 
-
-
-*/