Fork me on GitHub

Changeset a221d1f in git


Ignore:
Timestamp:
Dec 19, 2014, 2:52:00 AM (10 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
c04eb8a
Parents:
1c6dd69
Message:

add DitherTowerCenters parameter [close #363]

Location:
modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/Calorimeter.cc

    r1c6dd69 ra221d1f  
    8686{
    8787  ExRootConfParam param, paramEtaBins, paramPhiBins, paramFractions;
    88   Long_t i, j, k, size, sizeEtaBins, sizePhiBins, sizeFractions;
     88  Long_t i, j, k, size, sizeEtaBins, sizePhiBins;
    8989  Double_t ecalFraction, hcalFraction;
    9090  TBinMap::iterator itEtaBin;
     
    139139  {
    140140    paramFractions = param[i*2 + 1];
    141     sizeFractions = paramFractions.GetSize();
    142141
    143142    ecalFraction = paramFractions[0].GetDouble();
     
    155154
    156155  // read min E value for towers to be saved
    157   fEcalEnergyMin = GetDouble("EcalTowerMinEnergy", 0.0); 
    158   fHcalEnergyMin = GetDouble("HcalTowerMinEnergy", 0.0); 
    159  
    160   fEcalSigmaMin  = GetDouble("EcalTowerMinSignificance", 0.0); 
    161   fHcalSigmaMin  = GetDouble("HcalTowerMinSignificance", 0.0); 
    162 
    163  
     156  fEcalEnergyMin = GetDouble("EcalTowerMinEnergy", 0.0);
     157  fHcalEnergyMin = GetDouble("HcalTowerMinEnergy", 0.0);
     158
     159  fEcalSigmaMin  = GetDouble("EcalTowerMinSignificance", 0.0);
     160  fHcalSigmaMin  = GetDouble("HcalTowerMinSignificance", 0.0);
     161
     162
    164163  // read resolution formulas
    165164  fECalResolutionFormula->Compile(GetString("ECalResolutionFormula", "0"));
     
    176175  fTowerOutputArray = ExportArray(GetString("TowerOutputArray", "towers"));
    177176  fPhotonOutputArray = ExportArray(GetString("PhotonOutputArray", "photons"));
    178  
     177
    179178  fEFlowTrackOutputArray = ExportArray(GetString("EFlowTrackOutputArray", "eflowTracks"));
    180179  fEFlowPhotonOutputArray = ExportArray(GetString("EFlowPhotonOutputArray", "eflowPhotons"));
    181180  fEFlowNeutralHadronOutputArray = ExportArray(GetString("EFlowNeutralHadronOutputArray", "eflowNeutralHadrons"));
    182181
    183 
     182  fDitherTowerCenter = GetBool("DitherTowerCenters", true);
    184183}
    185184
     
    366365      fTrackHCalTime = 0.0;
    367366
    368       fTowerECalWeightTime = 0.0; 
     367      fTowerECalWeightTime = 0.0;
    369368      fTowerHCalWeightTime = 0.0;
    370      
     369
    371370      fTowerTrackHits = 0;
    372371      fTowerPhotonHits = 0;
    373      
     372
    374373      fTowerTrackArray->Clear();
    375374    }
     
    384383      position = track->Position;
    385384
    386      
     385
    387386      ecalEnergy = momentum.E() * fTrackECalFractions[number];
    388387      hcalEnergy = momentum.E() * fTrackHCalFractions[number];
     
    390389      fTrackECalEnergy += ecalEnergy;
    391390      fTrackHCalEnergy += hcalEnergy;
    392      
     391
    393392      fTrackECalTime += TMath::Sqrt(ecalEnergy)*position.T();
    394393      fTrackHCalTime += TMath::Sqrt(hcalEnergy)*position.T();
    395        
     394
    396395      fTrackECalWeightTime += TMath::Sqrt(ecalEnergy);
    397396      fTrackHCalWeightTime += TMath::Sqrt(hcalEnergy);
     
    401400      continue;
    402401    }
    403    
     402
    404403    // check for photon and electron hits in current tower
    405404    if(flags & 2) ++fTowerPhotonHits;
    406    
     405
    407406    particle = static_cast<Candidate*>(fParticleInputArray->At(number));
    408407    momentum = particle->Momentum;
     
    421420    fTowerECalWeightTime += TMath::Sqrt(ecalEnergy);
    422421    fTowerHCalWeightTime += TMath::Sqrt(hcalEnergy);
    423    
     422
    424423
    425424    fTower->AddCandidate(particle);
     
    462461  hcalTime = (fTowerHCalWeightTime < 1.0E-09 ) ? 0 : fTowerHCalTime/fTowerHCalWeightTime;
    463462
    464  
     463
    465464  ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, ecalEnergy);
    466465  hcalSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, hcalEnergy);
     
    470469
    471470  energy = ecalEnergy + hcalEnergy;
    472   time = (TMath::Sqrt(ecalEnergy)*ecalTime + TMath::Sqrt(hcalEnergy)*hcalTime)/(TMath::Sqrt(ecalEnergy) + TMath::Sqrt(hcalEnergy));
    473 
    474 //  eta = fTowerEta;
    475 //  phi = fTowerPhi;
    476 
    477   eta = gRandom->Uniform(fTowerEdges[0], fTowerEdges[1]);
    478   phi = gRandom->Uniform(fTowerEdges[2], fTowerEdges[3]);
     471  time = (TMath::Sqrt(ecalEnergy)*ecalTime + TMath::Sqrt(hcalEnergy)*hcalTime)/(TMath::Sqrt(ecalEnergy) + TMath::Sqrt(hcalEnergy));
     472
     473  if(fDitherTowerCenter)
     474  {
     475     eta = gRandom->Uniform(fTowerEdges[0], fTowerEdges[1]);
     476     phi = gRandom->Uniform(fTowerEdges[2], fTowerEdges[3]);
     477  }
     478  else
     479  {
     480     eta = fTowerEta;
     481     phi = fTowerPhi;
     482  }
    479483
    480484  pt = energy / TMath::CosH(eta);
     
    497501      fPhotonOutputArray->Add(fTower);
    498502    }
    499    
     503
    500504    fTowerOutputArray->Add(fTower);
    501505  }
  • modules/Calorimeter.h

    r1c6dd69 ra221d1f  
    6363  Double_t fTowerECalEnergy, fTowerHCalEnergy;
    6464  Double_t fTrackECalEnergy, fTrackHCalEnergy;
    65  
     65
    6666  Double_t fTowerECalTime, fTowerHCalTime;
    6767  Double_t fTrackECalTime, fTrackHCalTime;
    68    
     68
    6969  Double_t fTowerECalWeightTime, fTowerHCalWeightTime;
    7070  Double_t fTrackECalWeightTime, fTrackHCalWeightTime;
    71  
     71
    7272  Int_t fTowerTrackHits, fTowerPhotonHits;
     73
     74  Bool_t fDitherTowerCenter;
    7375
    7476  Double_t fEcalEnergyMin;
    7577  Double_t fHcalEnergyMin;
    76  
     78
    7779  Double_t fEcalSigmaMin;
    7880  Double_t fHcalSigmaMin;
     
    103105  TObjArray *fTowerOutputArray; //!
    104106  TObjArray *fPhotonOutputArray; //!
    105  
     107
    106108  TObjArray *fEFlowTrackOutputArray; //!
    107109  TObjArray *fEFlowPhotonOutputArray; //!
Note: See TracChangeset for help on using the changeset viewer.