Fork me on GitHub

Changeset 839deb7 in git


Ignore:
Timestamp:
Jun 29, 2015, 10:27:47 PM (9 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
c1ce3fe
Parents:
5d2481f
Message:

fix variable names and formatting

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • classes/DelphesClasses.cc

    r5d2481f r839deb7  
    131131  NCharged(0),
    132132  NNeutrals(0),
    133   NSubJetsTrimmed(0),
    134   NSubJetsPruned(0),
    135   NSubJetsSoftDropped(0),
    136133  Beta(0),
    137134  BetaStar(0),
    138135  MeanSqDeltaR(0),
    139136  PTD(0),
    140   Ntimes(-1),
     137  NTimeHits(-1),
    141138  IsolationVar(-999),
    142139  IsolationVarRhoCorr(-999),
     
    145142  SumPtChargedPU(-999),
    146143  SumPt(-999),
     144  NSubJetsTrimmed(0),
     145  NSubJetsPruned(0),
     146  NSubJetsSoftDropped(0),
    147147  fFactory(0),
    148148  fArray(0)
     
    274274  object.MeanSqDeltaR = MeanSqDeltaR;
    275275  object.PTD = PTD;
    276   object.Ntimes = Ntimes;
     276  object.NTimeHits = NTimeHits;
    277277  object.IsolationVar = IsolationVar;
    278278  object.IsolationVarRhoCorr = IsolationVarRhoCorr;
     
    292292  object.Tau[3] = Tau[3];
    293293  object.Tau[4] = Tau[4];
    294  
     294
    295295  object.TrimmedP4[0] = TrimmedP4[0];
    296296  object.TrimmedP4[1] = TrimmedP4[1];
     
    316316  object.fArray = 0;
    317317
    318   // Copy cluster timing info
    319   copy(Ecal_E_t.begin(),Ecal_E_t.end(),back_inserter(object.Ecal_E_t));
     318  // copy cluster timing info
     319  copy(ECalEnergyTimePairs.begin(), ECalEnergyTimePairs.end(), back_inserter(object.ECalEnergyTimePairs));
    320320
    321321  if(fArray && fArray->GetEntriesFast() > 0)
     
    374374  MeanSqDeltaR = 0.0;
    375375  PTD = 0.0;
    376  
    377   Ntimes = 0;
    378   Ecal_E_t.clear();
    379  
     376
     377  NTimeHits = 0;
     378  ECalEnergyTimePairs.clear();
     379
    380380  IsolationVar = -999;
    381381  IsolationVarRhoCorr = -999;
     
    384384  SumPtChargedPU = -999;
    385385  SumPt = -999;
    386  
     386
    387387  FracPt[0] = 0.0;
    388388  FracPt[1] = 0.0;
     
    395395  Tau[3] = 0.0;
    396396  Tau[4] = 0.0;
    397  
     397
    398398  for(i = 0; i < 5; ++i)
    399399  {
    400400    TrimmedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
    401     PrunedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0); 
     401    PrunedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
    402402    SoftDroppedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
    403403  }
     
    406406  NSubJetsPruned = 0;
    407407  NSubJetsSoftDropped = 0;
    408  
     408
    409409  fArray = 0;
    410410}
  • classes/DelphesClasses.h

    r5d2481f r839deb7  
    443443
    444444  Float_t T; // ecal deposit time, averaged by sqrt(EM energy) over all particles, not smeared
    445   Int_t   Ntimes; // number of hits contributing to time measurement
     445  Int_t NTimeHits; // number of hits contributing to time measurement
    446446
    447447  Float_t Eem; // calorimeter tower electromagnetic energy
     
    506506
    507507  Int_t IsConstituent;
    508  
     508
    509509  Int_t IsFromConversion;
    510  
     510
    511511  UInt_t Flavor;
    512512  UInt_t FlavorAlgo;
     
    528528  TLorentzVector Momentum, Position, Area;
    529529
    530   Float_t  Dxy;
    531   Float_t  SDxy;
    532   Float_t  Xd;
    533   Float_t  Yd;
    534   Float_t  Zd;
     530  Float_t Dxy;
     531  Float_t SDxy;
     532  Float_t Xd;
     533  Float_t Yd;
     534  Float_t Zd;
    535535
    536536  // PileUpJetID variables
    537537
    538   Int_t    NCharged;
    539   Int_t    NNeutrals;
    540   Float_t  Beta;
    541   Float_t  BetaStar;
    542   Float_t  MeanSqDeltaR;
    543   Float_t  PTD;
    544   Float_t  FracPt[5];
    545 
    546   //Timing information
    547 
    548   Int_t    Ntimes;
    549   std::vector<std::pair<Float_t,Float_t> > Ecal_E_t;
     538  Int_t NCharged;
     539  Int_t NNeutrals;
     540  Float_t Beta;
     541  Float_t BetaStar;
     542  Float_t MeanSqDeltaR;
     543  Float_t PTD;
     544  Float_t FracPt[5];
     545
     546  // Timing information
     547
     548  Int_t NTimeHits;
     549  std::vector< std::pair< Float_t, Float_t > > ECalEnergyTimePairs;
    550550
    551551  // Isolation variables
  • modules/Calorimeter.cc

    r5d2481f r839deb7  
    142142  }
    143143
    144 /*
    145   TFractionMap::iterator itFractionMap;
    146   for(itFractionMap = fFractionMap.begin(); itFractionMap != fFractionMap.end(); ++itFractionMap)
    147   {
    148     cout << itFractionMap->first << "   " << itFractionMap->second.first  << "   " << itFractionMap->second.second << endl;
    149   }
    150 */
    151 
    152144  // read min E value for timing measurement in ECAL
    153   fTimingEMin = GetDouble("TimingEMin",4.);
     145  fTimingEnergyMin = GetDouble("TimingEnergyMin",4.);
    154146  // For timing
    155147  // So far this flag needs to be false
     
    157149  fElectronsFromTrack = false;
    158150
    159  
    160151  // read min E value for towers to be saved
    161152  fECalEnergyMin = GetDouble("ECalEnergyMin", 0.0);
     
    385376      fTrackHCalEnergy += hcalEnergy;
    386377
    387       bool dbg_scz = false;
    388       if (dbg_scz) {
    389         cout << "   Calorimeter input track has x y z t " << track->Position.X() << " " << track->Position.Y() << " " << track->Position.Z() << " " << track->Position.T()
    390              << endl;
    391         Candidate *prt = static_cast<Candidate*>(track->GetCandidates()->Last());
    392         const TLorentzVector &ini = prt->Position;
    393 
    394         cout << "                and parent has x y z t " << ini.X() << " " << ini.Y() << " " << ini.Z() << " " << ini.T();
    395 
     378      if(ecalEnergy > fTimingEnergyMin && fTower)
     379      {
     380        if(fElectronsFromTrack)
     381        {
     382          fTower->ECalEnergyTimePairs.push_back(make_pair<Float_t, Float_t>(ecalEnergy, track->Position.T()));
     383        }
    396384      }
    397      
    398       if (ecalEnergy > fTimingEMin && fTower) {
    399         if (fElectronsFromTrack) {
    400           //      cout << " SCZ Debug pushing back track hit E=" << ecalEnergy << " T=" << track->Position.T() << " isPU=" << track->IsPU << " isRecoPU=" << track->IsRecoPU
    401           //           << " PID=" << track->PID << endl;
    402           fTower->Ecal_E_t.push_back(std::make_pair<float,float>(ecalEnergy,track->Position.T()));
    403         } else {
    404           //      cout << " Skipping track hit E=" << ecalEnergy << " T=" << track->Position.T() << " isPU=" << track->IsPU << " isRecoPU=" << track->IsRecoPU
    405           //           << " PID=" << track->PID << endl;
    406         }
    407       }
    408 
    409385
    410386      fTowerTrackArray->Add(track);
     
    412388      continue;
    413389    }
    414  
     390
    415391    // check for photon and electron hits in current tower
    416392    if(flags & 2) ++fTowerPhotonHits;
     
    427403    fTowerHCalEnergy += hcalEnergy;
    428404
    429     if (ecalEnergy > fTimingEMin && fTower) {
    430       if (abs(particle->PID) != 11 || !fElectronsFromTrack) {
    431         //      cout << " SCZ Debug About to push back particle hit E=" << ecalEnergy << " T=" << particle->Position.T() << " isPU=" << particle->IsPU
    432         //   << " PID=" << particle->PID << endl;
    433         fTower->Ecal_E_t.push_back(std::make_pair<Float_t,Float_t>(ecalEnergy,particle->Position.T()));
    434       } else {
    435        
    436         // N.B. Only charged particle set to leave ecal energy is the electrons
    437         //      cout << " SCZ Debug To avoid double-counting, skipping particle hit E=" << ecalEnergy << " T=" << particle->Position.T() << " isPU=" << particle->IsPU
    438         //           << " PID=" << particle->PID << endl;
    439        
     405    if(ecalEnergy > fTimingEnergyMin && fTower)
     406    {
     407      if (abs(particle->PID) != 11 || !fElectronsFromTrack)
     408      {
     409        fTower->ECalEnergyTimePairs.push_back(make_pair<Float_t, Float_t>(ecalEnergy, particle->Position.T()));
    440410      }
    441411    }
     
    456426  Double_t ecalEnergy, hcalEnergy;
    457427  Double_t ecalSigma, hcalSigma;
    458  
     428  Float_t weight, sumWeightedTime, sumWeight;
     429
    459430  if(!fTower) return;
    460431
     
    472443
    473444  energy = ecalEnergy + hcalEnergy;
    474    
     445
    475446  if(fSmearTowerCenter)
    476447  {
     
    487458
    488459  // Time calculation for tower
    489   fTower->Ntimes = 0;
    490   Float_t tow_sumT = 0;
    491   Float_t tow_sumW = 0;
    492  
    493   for (Int_t i = 0 ; i < fTower->Ecal_E_t.size() ; i++)
    494   {
    495     Float_t w = TMath::Sqrt(fTower->Ecal_E_t[i].first);
    496     tow_sumT += w*fTower->Ecal_E_t[i].second;
    497     tow_sumW += w;
    498     fTower->Ntimes++;
    499   }
    500  
    501   if (tow_sumW > 0.) {
    502     fTower->Position.SetPtEtaPhiE(1.0, eta, phi,tow_sumT/tow_sumW);
    503   } else {
    504     fTower->Position.SetPtEtaPhiE(1.0,eta,phi,999999.);
     460  fTower->NTimeHits = 0;
     461  sumWeightedTime = 0.0;
     462  sumWeight = 0.0;
     463
     464  for(size_t i = 0; i < fTower->ECalEnergyTimePairs.size(); ++i)
     465  {
     466    weight = TMath::Sqrt(fTower->ECalEnergyTimePairs[i].first);
     467    sumWeightedTime += weight * fTower->ECalEnergyTimePairs[i].second;
     468    sumWeight += weight;
     469    fTower->NTimeHits++;
     470  }
     471
     472  if(sumWeight > 0.0)
     473  {
     474    fTower->Position.SetPtEtaPhiE(1.0, eta, phi, sumWeightedTime/sumWeight);
     475  }
     476  else
     477  {
     478    fTower->Position.SetPtEtaPhiE(1.0, eta, phi, 999999.9);
    505479  }
    506480
  • modules/Calorimeter.h

    r5d2481f r839deb7  
    6060  Double_t fTrackECalEnergy, fTrackHCalEnergy;
    6161
    62   Double_t fTimingEMin;
    63   Bool_t fElectronsFromTrack; // for timing
    64  
     62  Double_t fTimingEnergyMin;
     63  Bool_t fElectronsFromTrack;
     64
    6565  Int_t fTowerTrackHits, fTowerPhotonHits;
    6666
  • modules/PileUpJetID.cc

    r5d2481f r839deb7  
    154154    float sumT40 = 0.;
    155155    float sumWeightsForT = 0.;
    156     candidate->Ntimes = 0;
     156    candidate->NTimeHits = 0;
    157157
    158158    float sumpt = 0.;
     
    197197        float tow_sumT = 0;
    198198        float tow_sumW = 0;
    199         for (int i = 0 ; i < constituent->Ecal_E_t.size() ; i++) {
    200           float w = TMath::Sqrt(constituent->Ecal_E_t[i].first);
     199        for (int i = 0 ; i < constituent->ECalEnergyTimePairs.size() ; i++) {
     200          float w = TMath::Sqrt(constituent->ECalEnergyTimePairs[i].first);
    201201          if (fAverageEachTower) {
    202             tow_sumT += w*constituent->Ecal_E_t[i].second;
     202            tow_sumT += w*constituent->ECalEnergyTimePairs[i].second;
    203203            tow_sumW += w;
    204204          } else {
    205             sumT0 += w*constituent->Ecal_E_t[i].second;
    206             sumT1 += w*gRandom->Gaus(constituent->Ecal_E_t[i].second,0.001);
    207             sumT10 += w*gRandom->Gaus(constituent->Ecal_E_t[i].second,0.010);
    208             sumT20 += w*gRandom->Gaus(constituent->Ecal_E_t[i].second,0.020);
    209             sumT30 += w*gRandom->Gaus(constituent->Ecal_E_t[i].second,0.030);
    210             sumT40 += w*gRandom->Gaus(constituent->Ecal_E_t[i].second,0.040);
     205            sumT0 += w*constituent->ECalEnergyTimePairs[i].second;
     206            sumT1 += w*gRandom->Gaus(constituent->ECalEnergyTimePairs[i].second,0.001);
     207            sumT10 += w*gRandom->Gaus(constituent->ECalEnergyTimePairs[i].second,0.010);
     208            sumT20 += w*gRandom->Gaus(constituent->ECalEnergyTimePairs[i].second,0.020);
     209            sumT30 += w*gRandom->Gaus(constituent->ECalEnergyTimePairs[i].second,0.030);
     210            sumT40 += w*gRandom->Gaus(constituent->ECalEnergyTimePairs[i].second,0.040);
    211211            sumWeightsForT += w;
    212             candidate->Ntimes++;
     212            candidate->NTimeHits++;
    213213          }
    214214        }
     
    221221          sumT40 += tow_sumW*gRandom->Gaus(tow_sumT/tow_sumW,0.0040);
    222222          sumWeightsForT += tow_sumW;
    223           candidate->Ntimes++;
     223          candidate->NTimeHits++;
    224224        }
    225225      }
  • modules/TreeWriter.cc

    r5d2481f r839deb7  
    362362
    363363    entry->T = position.T()*1.0E-3/c_light;
    364     entry->Ntimes = candidate->Ntimes;
     364    entry->NTimeHits = candidate->NTimeHits;
    365365
    366366    FillParticles(candidate, &entry->Particles);
Note: See TracChangeset for help on using the changeset viewer.