Fork me on GitHub

Changeset 341014c in git for modules/TauTagging.cc


Ignore:
Timestamp:
Feb 12, 2019, 9:29:17 PM (6 years ago)
Author:
Pavel Demin <pavel-demin@…>
Branches:
ImprovedOutputFile, Timing, llp, master
Children:
6455202
Parents:
45e58be
Message:

apply .clang-format to all .h, .cc and .cpp files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/TauTagging.cc

    r45e58be r341014c  
    1717 */
    1818
    19 
    2019/** \class TauTagging
    2120 *
     
    3433#include "classes/DelphesFormula.h"
    3534
     35#include "TDatabasePDG.h"
     36#include "TFormula.h"
     37#include "TLorentzVector.h"
    3638#include "TMath.h"
     39#include "TObjArray.h"
     40#include "TRandom3.h"
    3741#include "TString.h"
    38 #include "TFormula.h"
    39 #include "TRandom3.h"
    40 #include "TObjArray.h"
    41 #include "TDatabasePDG.h"
    42 #include "TLorentzVector.h"
    4342
    4443#include <algorithm>
    45 #include <stdexcept>
    4644#include <iostream>
    4745#include <sstream>
     46#include <stdexcept>
    4847
    4948using namespace std;
    50 
    5149
    5250//------------------------------------------------------------------------------
     
    6361  Candidate *daughter1 = 0;
    6462  Candidate *daughter2 = 0;
    65  
     63
    6664  const TLorentzVector &momentum = tau->Momentum;
    6765  Int_t pdgCode, i, j;
     
    7674  if(tau->D2 < tau->D1) return -1;
    7775
    78   if(tau->D1 >= fParticleInputArray->GetEntriesFast() ||
    79      tau->D2 >= fParticleInputArray->GetEntriesFast())
     76  if(tau->D1 >= fParticleInputArray->GetEntriesFast() || tau->D2 >= fParticleInputArray->GetEntriesFast())
    8077  {
    8178    throw runtime_error("tau's daughter index is greater than the ParticleInputArray size");
     
    8683    daughter1 = static_cast<Candidate *>(fParticleInputArray->At(i));
    8784    pdgCode = TMath::Abs(daughter1->PID);
    88     if(pdgCode == 11 || pdgCode == 13 || pdgCode == 15) return -1;
     85    if(pdgCode == 11 || pdgCode == 13 || pdgCode == 15)
     86      return -1;
    8987    else if(pdgCode == 24)
    9088    {
    91      if(daughter1->D1 < 0) return -1;
    92      for(j = daughter1->D1; j <= daughter1->D2; ++j)
    93      {
    94        daughter2 = static_cast<Candidate*>(fParticleInputArray->At(j));
    95        pdgCode = TMath::Abs(daughter2->PID);
    96        if(pdgCode == 11 || pdgCode == 13) return -1;
    97      }
    98        
     89      if(daughter1->D1 < 0) return -1;
     90      for(j = daughter1->D1; j <= daughter1->D2; ++j)
     91      {
     92        daughter2 = static_cast<Candidate *>(fParticleInputArray->At(j));
     93        pdgCode = TMath::Abs(daughter2->PID);
     94        if(pdgCode == 11 || pdgCode == 13) return -1;
     95      }
    9996    }
    10097  }
     
    121118void TauTagging::Init()
    122119{
    123   map< Int_t, DelphesFormula * >::iterator itEfficiencyMap;
     120  map<Int_t, DelphesFormula *>::iterator itEfficiencyMap;
    124121  ExRootConfParam param;
    125122  DelphesFormula *formula;
     
    135132
    136133  fEfficiencyMap.clear();
    137   for(i = 0; i < size/2; ++i)
     134  for(i = 0; i < size / 2; ++i)
    138135  {
    139136    formula = new DelphesFormula;
    140     formula->Compile(param[i*2 + 1].GetString());
    141 
    142     fEfficiencyMap[param[i*2].GetInt()] = formula;
     137    formula->Compile(param[i * 2 + 1].GetString());
     138
     139    fEfficiencyMap[param[i * 2].GetInt()] = formula;
    143140  }
    144141
     
    174171void TauTagging::Finish()
    175172{
    176   map< Int_t, DelphesFormula * >::iterator itEfficiencyMap;
     173  map<Int_t, DelphesFormula *>::iterator itEfficiencyMap;
    177174  DelphesFormula *formula;
    178175
     
    197194  Double_t pt, eta, phi, e, eff;
    198195  TObjArray *tauArray;
    199   map< Int_t, DelphesFormula * >::iterator itEfficiencyMap;
     196  map<Int_t, DelphesFormula *>::iterator itEfficiencyMap;
    200197  DelphesFormula *formula;
    201198  Int_t pdgCode, charge, i;
     
    218215
    219216    // loop over all input taus
    220     if(tauArray){
     217    if(tauArray)
     218    {
    221219      TIter itTauArray(tauArray);
    222220      while((tau = static_cast<Candidate *>(itTauArray.Next())))
     
    224222        if(tau->D1 < 0) continue;
    225223
    226         if(tau->D1 >= fParticleInputArray->GetEntriesFast() ||
    227            tau->D2 >= fParticleInputArray->GetEntriesFast())
     224        if(tau->D1 >= fParticleInputArray->GetEntriesFast() || tau->D2 >= fParticleInputArray->GetEntriesFast())
    228225        {
    229226          throw runtime_error("tau's daughter index is greater than the ParticleInputArray size");
     
    257254    eff = formula->Eval(pt, eta, phi, e);
    258255    jet->TauTag |= (gRandom->Uniform() <= eff) << fBitNumber;
    259     jet->TauWeight = eff;     
     256    jet->TauWeight = eff;
    260257
    261258    // set tau charge
Note: See TracChangeset for help on using the changeset viewer.