34 #include "FairRootManager.h" 
   35 #include "FairRunAna.h" 
   36 #include "FairRuntimeDb.h" 
   53 f(new TFile()), f0(new TFile()), 
f1(new TFile()), 
f2(new TFile()), 
f3(new TFile()), fClusterIndex(-1), fClusterArray(0), fClusterArrayCorr(0), fDigiPar(new 
PndEmcDigiPar()), fRecoPar(new 
PndEmcRecoPar()), 
fVerbose(0), fStoreClustersCorr(kTRUE), fModel(transportModel), fClusterType(clusterType)  
 
   55   cout<<
"PndEmcMakeCorr  constructor: "<<
fClusterType<<endl;
 
   84   FairRootManager* ioman = FairRootManager::Instance();
 
   86     cout << 
"-E- PndEmcMakeCorr::Init: " 
   87          << 
"RootManager not instantiated!" << endl;
 
   94   cout << 
"-------------> fClusterType is: *****  "<<
fClusterType<<
"  *****"<<endl;
 
   96     cout << 
"-W- PndEmcMakeCorr::Init: " 
  111   cout<<
"Used transportModel is " <<
fModel <<endl;
 
  113   TString work = getenv(
"VMCWORKDIR");
 
  115   work += 
"/macro/params/";
 
  116   cout<<
"directory is::   "<<work<<endl;
 
  118   for (Int_t 
i=0; 
i<4; 
i++){
 
  132   cout<<
"== PLEASE CHECK if the correction map exists for an appropriate PARTICLE & TRANSPORT MODEL!!! "<<endl;
 
  133   cout<<
"============================================================================================= "<<endl;
 
  136   for(
int i=0; 
i< 4; 
i++){
 
  140     sprintf(buffer, 
"%i", myInteger);
 
  143     f= 
new TFile(work1[
i],
"READ");
 
  144     cout<< 
"File "<<
f->GetName() << 
" is read"<<endl;
 
  173   bin_x = lookup_table->GetXaxis()->FindBin(value_x);
 
  174   bin_y = lookup_table->GetYaxis()->FindBin(value_y);
 
  176   if ((bin_x < 1) || (bin_x > lookup_table->GetXaxis()->GetNbins()))
 
  178       bin_x = -1; bin_y = -1; 
 
  182   if ((bin_y < 1) || (bin_y > lookup_table->GetYaxis()->GetNbins()))
 
  184       bin_x = -1; bin_y = -1; 
 
  197   if (use_interpolation)
 
  210       return (lookup_table->Interpolate(value_x,value_y));
 
  215       Int_t binx, biny, retval;
 
  217       retval = 
FindTheBin(lookup_table, value_x, value_y, binx, biny);
 
  220           cout << 
"<E> Error in FindTheBin, check your table and input values!!!!: " << retval << endl;
 
  224       return (lookup_table->GetBinContent(binx,biny));
 
  236   Bool_t use_interpolation=kTRUE;
 
  237   Double_t valzEn[4], valzTh[4], ThCorr[4],  EnCorr[4];
 
  240   Int_t chosenModule =0;
 
  247   for (Int_t iCluster=0; iCluster<clustLength; iCluster++) 
 
  267         cout<<
"None of the Cluster object is taken !!!"<<endl;
 
  272       std::map<Int_t,Int_t>::iterator iter;
 
  276       std::map<int, int> counting;
 
  277       std::map<int, int>::iterator iCounting;
 
  278       Int_t oldCounting = 0;
 
  280       if(digiMap.size() != 0)
 
  282           for(iter=digiMap.begin(); iter != digiMap.end(); ++iter)
 
  285               module = ID/100000000;
 
  291       for(iCounting=counting.begin(); iCounting!=counting.end(); iCounting++)
 
  293           if((*iCounting).second > oldCounting)
 
  295               chosenModule = (*iCounting).first;
 
  296               oldCounting = (*iCounting).second;
 
  301       TVector3 position=theCluster->
where();
 
  308       for (Int_t 
i=0; 
i<4; 
i++)
 
  310           if (chosenModule==5){      
 
  318             EnCorr[
i] = energy/valzEn[
i];
 
  325             if (theta <6.) 
continue; 
 
  333             EnCorr[
i] = energy/valzEn[
i];
 
  342       new((*fClusterArrayCorr)[iCluster]) 
PndEmcCorrection(chosenModule, EnCorr[0], EnCorr[1], EnCorr[2], EnCorr[3], ThCorr[0], ThCorr[1], ThCorr[2], ThCorr[3], valzEn[0], valzEn[1], valzEn[2], valzEn[3], valzTh[0], valzTh[1], valzTh[2], valzTh[3]);
 
  350   FairRun* 
run = FairRun::Instance();
 
  351   if ( ! run ) Fatal(
"SetParContainers", 
"No analysis run");
 
  353   FairRuntimeDb* db = run->GetRuntimeDb();
 
  354   if ( ! db ) Fatal(
"SetParContainers", 
"No runtime database");
 
virtual InitStatus Init()
Double_t val[nBoxes][nFEBox]
PndEmcMakeCorr(Int_t verbose=0, TString transportModel="TGeant3", TString clusterType="EmcBump")
Bool_t fStoreClustersCorr
TClonesArray * fClusterArrayCorr
Double_t GetValueInZ(TH2 *lookup_table, Float_t value_x, Float_t value_y, Bool_t use_interpolation=kFALSE)
parameter set of Emc digitisation 
a cluster (group of neighboring crystals) of hit emc crystals 
const std::map< Int_t, Int_t > & MemberDigiMap() const 
virtual void SetParContainers()
virtual ~PndEmcMakeCorr()
virtual Double_t energy() const 
Int_t FindTheBin(TH2 *lookup_table, Float_t value_x, Float_t value_y, Int_t &bin_x, Int_t &bin_y)
void SetStorageOfData(Bool_t val)
represents a reconstructed (splitted) emc cluster 
Parameter set for Emc Reco. 
virtual void Exec(Option_t *opt)
TClonesArray * fClusterArray