Fork me on GitHub

Changeset 1372 in svn for trunk/modules


Ignore:
Timestamp:
Apr 17, 2014, 10:54:17 AM (11 years ago)
Author:
Pavel Demin
Message:

several minor corrections

Location:
trunk/modules
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/FastJetFinder.cc

    r1368 r1372  
    4747#include "fastjet/plugins/CDFCones/fastjet/CDFJetCluPlugin.hh"
    4848
    49 #include "fastjet/contribs/Nsubjettiness/Nsubjettiness.hh" 
     49#include "fastjet/contribs/Nsubjettiness/Nsubjettiness.hh"
    5050#include "fastjet/contribs/Nsubjettiness/Njettiness.hh"
    5151#include "fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh"
     
    7676void FastJetFinder::Init()
    7777{
    78  
     78
    7979  JetDefinition::Plugin *plugin = NULL;
    8080  JetDefinition::Recombiner *recomb = NULL;
    8181  NjettinessPlugin *njet_plugin = NULL;
    82  
     82
    8383  // read eta ranges
    8484
     
    110110
    111111  //-- N(sub)jettiness parameters --
    112  
     112
    113113  fComputeNsubjettiness = GetBool("ComputeNsubjettiness", false);
    114114  fBeta = GetDouble("Beta", 1.0);
    115115  fAxisMode = GetInt("AxisMode", 1);
    116   fRcutOff = GetDouble("RcutOff", 0.8); //used only if Njettiness is used as jet clustering algo (case 8)
    117   fN = GetInt("N", 2);                  //used only if Njettiness is used as jet clustering algo (case 8)
    118  
     116  fRcutOff = GetDouble("RcutOff", 0.8); // used only if Njettiness is used as jet clustering algo (case 8)
     117  fN = GetInt("N", 2);                  // used only if Njettiness is used as jet clustering algo (case 8)
     118
    119119  // ---  Jet Area Parameters ---
    120120  fAreaAlgorithm = GetInt("AreaAlgorithm", 0);
    121121  fComputeRho = GetBool("ComputeRho", false);
    122  
     122
    123123  // - ghost based areas -
    124124  fGhostEtaMax = GetDouble("GhostEtaMax", 5.0);
     
    128128  fPtScatter = GetDouble("PtScatter", 0.1);
    129129  fMeanGhostPt = GetDouble("MeanGhostPt", 1.0E-100);
    130  
     130
    131131  // - voronoi based areas -
    132132  fEffectiveRfact = GetDouble("EffectiveRfact", 1.0);
     
    188188      break;
    189189  }
    190  
    191190
    192191  fPlugin = plugin;
    193192  fRecomb = recomb;
    194193  fNjettinessPlugin = njet_plugin;
    195  
     194
    196195  ClusterSequence::print_banner();
    197196
     
    299298    inputList.clear();
    300299    inputList = sequence->constituents(*itOutputList);
    301      
     300
    302301    for(itInputList = inputList.begin(); itInputList != inputList.end(); ++itInputList)
    303302    {
     
    308307      if(deta > detaMax) detaMax = deta;
    309308      if(dphi > dphiMax) dphiMax = dphi;
    310      
     309
    311310      time += TMath::Sqrt(constituent->Momentum.E())*(constituent->Position.T());
    312311      weightTime += TMath::Sqrt(constituent->Momentum.E());
    313    
     312
    314313      candidate->AddCandidate(constituent);
    315314    }
    316    
     315
    317316    avTime = time/weightTime;
    318317
     
    325324
    326325    // --- compute N-subjettiness with N = 1,2,3,4,5 ----
    327    
     326
    328327    if(fComputeNsubjettiness)
    329328    {
    330329      Njettiness::AxesMode axisMode;
    331      
    332       if (fAxisMode == 1) axisMode = Njettiness::wta_kt_axes;
    333       if (fAxisMode == 2) axisMode = Njettiness::onepass_wta_kt_axes;
    334       if (fAxisMode == 3) axisMode = Njettiness::kt_axes;
    335       if (fAxisMode == 4) axisMode = Njettiness::onepass_kt_axes;
    336        
     330
     331      switch(fAxisMode)
     332      {
     333        default:
     334        case 1:
     335          axisMode = Njettiness::wta_kt_axes;
     336          break;
     337        case 2:
     338          axisMode = Njettiness::onepass_wta_kt_axes;
     339          break;
     340        case 3:
     341          axisMode = Njettiness::kt_axes;
     342          break;
     343        case 4:
     344          axisMode = Njettiness::onepass_kt_axes;
     345          break;
     346      }
     347
    337348      Njettiness::MeasureMode measureMode = Njettiness::unnormalized_measure;
    338      
     349
    339350      Nsubjettiness nSub1(1, axisMode, measureMode, fBeta);
    340351      Nsubjettiness nSub2(2, axisMode, measureMode, fBeta);
    341       Nsubjettiness nSub3(3, axisMode, measureMode, fBeta); 
    342       Nsubjettiness nSub4(4, axisMode, measureMode, fBeta); 
    343       Nsubjettiness nSub5(5, axisMode, measureMode, fBeta); 
    344    
    345       candidate -> Tau1 = nSub1(*itOutputList);
    346       candidate -> Tau2 = nSub2(*itOutputList);
    347       candidate -> Tau3 = nSub3(*itOutputList);
    348       candidate -> Tau4 = nSub4(*itOutputList);
    349       candidate -> Tau5 = nSub5(*itOutputList);
     352      Nsubjettiness nSub3(3, axisMode, measureMode, fBeta);
     353      Nsubjettiness nSub4(4, axisMode, measureMode, fBeta);
     354      Nsubjettiness nSub5(5, axisMode, measureMode, fBeta);
     355
     356      candidate->Tau[0] = nSub1(*itOutputList);
     357      candidate->Tau[1] = nSub2(*itOutputList);
     358      candidate->Tau[2] = nSub3(*itOutputList);
     359      candidate->Tau[3] = nSub4(*itOutputList);
     360      candidate->Tau[4] = nSub5(*itOutputList);
    350361    }
    351362
  • trunk/modules/FastJetFinder.h

    r1368 r1372  
    4343  void *fRecomb; //!
    4444  void *fNjettinessPlugin; //!
    45  
     45
    4646  fastjet::JetDefinition *fDefinition; //!
    4747
     
    5959
    6060  //-- N (sub)jettiness parameters --
    61  
     61
    6262  Bool_t fComputeNsubjettiness;
    6363  Double_t fBeta;
    6464  Int_t fAxisMode;
    65   Double_t fRcutOff; 
     65  Double_t fRcutOff;
    6666  Int_t fN ;
    67  
     67
    6868  // --- FastJet Area method --------
    6969
  • trunk/modules/ImpactParameterSmearing.cc

    r1367 r1372  
    121121 
    122122    ddxy = gRandom->Gaus(0,fFormula->Eval(pt, eta));
    123     ddz  = gRandom->Gaus(0,fFormula->Eval(pt, eta));
     123    ddz = gRandom->Gaus(0,fFormula->Eval(pt, eta));
    124124 
    125125    //fill smeared values in candidate
     
    127127   
    128128    candidate = static_cast<Candidate*>(candidate->Clone());
    129     candidate -> Xd = xd;
    130     candidate -> Yd = yd;
    131     candidate -> Zd = zd;
     129    candidate->Xd = xd;
     130    candidate->Yd = yd;
     131    candidate->Zd = zd;
    132132   
    133     candidate -> Dxy = dxy;
    134     candidate -> SDxy = ddxy;
     133    candidate->Dxy = dxy;
     134    candidate->SDxy = ddxy;
    135135     
    136136    candidate->AddCandidate(mother);
    137137    fOutputArray->Add(candidate);
    138    
    139    
    140    
    141138  }
    142139}
  • trunk/modules/TrackCountingBTagging.cc

    r1367 r1372  
    22/** \class TrackCountingBTagging
    33 *
    4  *  btagging algorithm based on counting tracks with large impact parameterDetermines origin of jet,
     4 *  b-tagging algorithm based on counting tracks with large impact parameter
    55 *
    66 *  $Date: 2014-03-27 12:39:14 +0200 (Fri, 27 March 2014) $
     
    2525#include "TLorentzVector.h"
    2626
    27 #include <algorithm> 
     27#include <algorithm>
    2828#include <stdexcept>
    2929#include <iostream>
     
    3131
    3232using namespace std;
    33 
    3433
    3534//------------------------------------------------------------------------------
     
    5049void TrackCountingBTagging::Init()
    5150{
    52  
    5351  fBitNumber = GetInt("BitNumber", 0);
    54  
     52
    5553  fPtMin     = GetDouble("TrackPtMin", 1.0);
    5654  fDeltaR    = GetDouble("DeltaR", 0.3);
    5755  fIPmax     = GetDouble("TrackIPMax", 2.0);
    58  
     56
    5957  fSigMin    = GetDouble("SigMin", 6.5);
    60   fNtracks   = GetInt("Ntracks", 3); 
    61    
     58  fNtracks   = GetInt("Ntracks", 3);
     59
    6260  // import input array(s)
    6361
    6462  fTrackInputArray = ImportArray(GetString("TrackInputArray", "Calorimeter/eflowTracks"));
    6563  fItTrackInputArray = fTrackInputArray->MakeIterator();
    66  
     64
    6765  fJetInputArray = ImportArray(GetString("JetInputArray", "FastJetFinder/jets"));
    6866  fItJetInputArray = fJetInputArray->MakeIterator();
     
    8280{
    8381  Candidate *jet, *track;
    84  
     82
    8583  Double_t jpx, jpy;
    8684  Double_t dr, tpx, tpy, tpt;
    8785  Double_t xd, yd, dxy, ddxy, ip, sip;
    88  
     86
    8987  Int_t sign;
    90  
     88
    9189  Int_t count;
    92  
     90
    9391  // loop over all input jets
    9492  fItJetInputArray->Reset();
     
    9896    jpx = jetMomentum.Px();
    9997    jpy = jetMomentum.Py();
    100    
     98
    10199    // loop over all input tracks
    102100    fItTrackInputArray->Reset();
     
    104102    while((track = static_cast<Candidate*>(fItTrackInputArray->Next())))
    105103    {
    106      const TLorentzVector &trkMomentum = track->Momentum;
    107      
    108      dr = jetMomentum.DeltaR(trkMomentum);
    109      
    110      tpt = trkMomentum.Pt();
    111      tpx = trkMomentum.Px();
    112      tpy = trkMomentum.Py();
    113    
    114      xd   = track->Xd;
    115      yd   = track->Yd;
    116      dxy  = TMath::Abs(track->Dxy);
    117      ddxy = track->SDxy;
    118      
    119      if( tpt < fPtMin ) continue;
    120      if( dr  > fDeltaR ) continue;
    121      if( dxy > fIPmax ) continue;
    122        
    123      sign  = ( jpx*xd + jpy*yd > 0.0 ) ? 1 : -1;
    124        
    125      ip  = sign*dxy;
    126      sip = ip / TMath::Abs(ddxy);
    127      
    128      if( sip > fSigMin ) count++;
    129      
     104      const TLorentzVector &trkMomentum = track->Momentum;
     105
     106      dr = jetMomentum.DeltaR(trkMomentum);
     107
     108      tpt = trkMomentum.Pt();
     109      tpx = trkMomentum.Px();
     110      tpy = trkMomentum.Py();
     111
     112      xd   = track->Xd;
     113      yd   = track->Yd;
     114      dxy  = TMath::Abs(track->Dxy);
     115      ddxy = track->SDxy;
     116
     117      if(tpt < fPtMin) continue;
     118      if(dr  > fDeltaR) continue;
     119      if(dxy > fIPmax) continue;
     120
     121      sign  = (jpx*xd + jpy*yd > 0.0) ? 1 : -1;
     122
     123      ip  = sign*dxy;
     124      sip = ip / TMath::Abs(ddxy);
     125
     126      if(sip > fSigMin) count++;
    130127    }
    131      
     128
    132129    // set BTag flag to true if count >= Ntracks
    133     jet->BTag |= ( count >= fNtracks ) << fBitNumber;
     130    jet->BTag |= (count >= fNtracks) << fBitNumber;
    134131  }
    135132}
  • trunk/modules/TrackCountingBTagging.h

    r1367 r1372  
    44/** \class TrackCountingBTagging
    55 *
    6  *  btagging algorithm based on counting tracks with large impact parameter
     6 *  b-tagging algorithm based on counting tracks with large impact parameter
    77 *
    88 *  $Date: 2014-03-27 12:39:14 +0200 (Fri, 27 March 2014) $
     
    3535
    3636  Int_t fBitNumber;
    37  
     37
    3838  Double_t fPtMin;
    3939  Double_t fDeltaR;
     
    4141  Double_t fSigMin;
    4242  Int_t    fNtracks;
    43  
     43
    4444  TIterator *fItTrackInputArray; //!
    4545  TIterator *fItJetInputArray; //!
     
    4747  const TObjArray *fTrackInputArray; //!
    4848  const TObjArray *fJetInputArray; //!
    49  
     49
    5050  ClassDef(TrackCountingBTagging, 1)
    5151};
  • trunk/modules/TreeWriter.cc

    r1368 r1372  
    280280    entry->Dxy = candidate->Dxy;
    281281    entry->SDxy = candidate->SDxy ;
    282     entry->Xd = candidate -> Xd;
    283     entry->Yd = candidate -> Yd;
    284     entry->Zd = candidate -> Zd;
     282    entry->Xd = candidate->Xd;
     283    entry->Yd = candidate->Yd;
     284    entry->Zd = candidate->Zd;
    285285   
    286286    const TLorentzVector &momentum = candidate->Momentum;
     
    473473
    474474    entry->T = position.T()*1.0E-3/c_light;
    475 
    476    // cout<<entry->PT<<","<<entry->T<<endl;
    477475
    478476    entry->Charge = candidate->Charge;
     
    557555    //--- N-subjettiness variables ----
    558556   
    559     entry->Tau1 = candidate->Tau1;
    560     entry->Tau2 = candidate->Tau2;
    561     entry->Tau3 = candidate->Tau3;
    562     entry->Tau4 = candidate->Tau4;
    563     entry->Tau5 = candidate->Tau5;
     557    entry->Tau1 = candidate->Tau[0];
     558    entry->Tau2 = candidate->Tau[1];
     559    entry->Tau3 = candidate->Tau[2];
     560    entry->Tau4 = candidate->Tau[3];
     561    entry->Tau5 = candidate->Tau[4];
    564562   
    565563    FillParticles(candidate, &entry->Particles);
Note: See TracChangeset for help on using the changeset viewer.