Fork me on GitHub

Changeset d870fc5 in git for modules/PdgCodeFilter.cc


Ignore:
Timestamp:
Dec 21, 2014, 4:03:35 PM (10 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
d77b51d
Parents:
7f12612 (diff), e5767b57 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'upstream/master'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/PdgCodeFilter.cc

    r7f12612 rd870fc5  
    22 *  Delphes: a framework for fast simulation of a generic collider experiment
    33 *  Copyright (C) 2012-2014  Universite catholique de Louvain (UCL), Belgium
    4  * 
     4 *
    55 *  This program is free software: you can redistribute it and/or modify
    66 *  it under the terms of the GNU General Public License as published by
    77 *  the Free Software Foundation, either version 3 of the License, or
    88 *  (at your option) any later version.
    9  * 
     9 *
    1010 *  This program is distributed in the hope that it will be useful,
    1111 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    1212 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1313 *  GNU General Public License for more details.
    14  * 
     14 *
    1515 *  You should have received a copy of the GNU General Public License
    1616 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
     
    1919/** \class PdgCodeFilter
    2020 *
    21  *  Removes particles with specific pdg codes
     21 *  Removes particles with specific PDG codes
    2222 *
    2323 *  \author M. Selvaggi
     
    4040#include "TRandom3.h"
    4141#include "TObjArray.h"
    42 //#include "TDatabasePDG.h"
     42#include "TDatabasePDG.h"
    4343#include "TLorentzVector.h"
    4444
     
    6767void PdgCodeFilter::Init()
    6868{
    69  
     69
    7070  ExRootConfParam param;
    7171  Size_t i, size;
    72  
     72
    7373  // PT threshold
    7474  fPTMin = GetDouble("PTMin", 0.0);
     
    7777  fInputArray = ImportArray(GetString("InputArray", "Delphes/allParticles"));
    7878  fItInputArray = fInputArray->MakeIterator();
    79  
     79
    8080  param = GetParam("PdgCode");
    8181  size = param.GetSize();
    8282
    8383  // read PdgCodes to be filtered out from the data card
    84  
     84
    8585  fPdgCodes.clear();
    8686  for(i = 0; i < size; ++i)
     
    8888    fPdgCodes.push_back(param[i].GetInt());
    8989  }
    90  
     90
    9191  // create output array
    9292  fOutputArray = ExportArray(GetString("OutputArray", "filteredParticles"));
     
    115115    const TLorentzVector &candidateMomentum = candidate->Momentum;
    116116    pt = candidateMomentum.Pt();
    117    
     117
    118118    pass = kTRUE;
    119119
    120     if( pt < fPTMin ) pass = kFALSE;
    121     if( find(fPdgCodes.begin(), fPdgCodes.end(), pdgCode) != fPdgCodes.end() ) pass = kFALSE;
     120    if(pt < fPTMin) pass = kFALSE;
     121    if(find(fPdgCodes.begin(), fPdgCodes.end(), pdgCode) != fPdgCodes.end()) pass = kFALSE;
    122122
    123     if (pass) fOutputArray->Add(candidate);
     123    if(pass) fOutputArray->Add(candidate);
    124124  }
    125125}
Note: See TracChangeset for help on using the changeset viewer.