Fork me on GitHub

Changeset 7278220 in git


Ignore:
Timestamp:
Dec 21, 2014, 9:37:54 PM (10 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
b78adf8
Parents:
d4b9697
Message:

replace map with vector< TEstimatorStruct > and replace SelectorAbsRapRange with SelectorEtaRange

Location:
modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/FastJetFinder.cc

    rd4b9697 r7278220  
    9292  JetDefinition::Plugin *plugin = 0;
    9393  JetDefinition::Recombiner *recomb = 0;
    94   NjettinessPlugin *njetPlugin = 0;
    95 
    96   // read eta ranges
    97 
    98   ExRootConfParam param = GetParam("RhoEtaRange");
     94  ExRootConfParam param;
    9995  Long_t i, size;
    100 
    101   fEtaRangeMap.clear();
    102   size = param.GetSize();
    103   for(i = 0; i < size/2; ++i)
    104   {
    105     fEtaRangeMap[param[i*2].GetDouble()] = param[i*2 + 1].GetDouble();
    106   }
     96  Double_t etaMin, etaMax;
     97  TEstimatorStruct estimatorStruct;
    10798
    10899  // define algorithm
     
    197188      break;
    198189    case 8:
    199       njetPlugin = new NjettinessPlugin(fN, Njettiness::wta_kt_axes, Njettiness::unnormalized_cutoff_measure, fBeta, fRcutOff);
    200       fDefinition = new JetDefinition(njetPlugin);
     190      fNjettinessPlugin = new NjettinessPlugin(fN, Njettiness::wta_kt_axes, Njettiness::unnormalized_cutoff_measure, fBeta, fRcutOff);
     191      fDefinition = new JetDefinition(fNjettinessPlugin);
    201192      break;
    202193  }
     
    204195  fPlugin = plugin;
    205196  fRecomb = recomb;
    206   fNjettinessPlugin = njetPlugin;
    207197
    208198  ClusterSequence::print_banner();
     199
     200  if(fComputeRho && fAreaDefinition)
     201  {
     202    // read eta ranges
     203
     204    param = GetParam("RhoEtaRange");
     205    size = param.GetSize();
     206
     207    fEstimators.clear();
     208    for(i = 0; i < size/2; ++i)
     209    {
     210      etaMin = param[i*2].GetDouble();
     211      etaMax = param[i*2 + 1].GetDouble();
     212      estimatorStruct.estimator = new JetMedianBackgroundEstimator(SelectorEtaRange(etaMin, etaMax), *fDefinition, *fAreaDefinition);
     213      estimatorStruct.etaMin = etaMin;
     214      estimatorStruct.etaMax = etaMax;
     215      fEstimators.push_back(estimatorStruct);
     216    }
     217  }
    209218
    210219  // import input array
     
    223232void FastJetFinder::Finish()
    224233{
     234  vector< TEstimatorStruct >::iterator itEstimators;
     235
     236  for(itEstimators = fEstimators.begin(); itEstimators != fEstimators.end(); ++itEstimators)
     237  {
     238    if(itEstimators->estimator) delete itEstimators->estimator;
     239  }
     240
    225241  if(fItInputArray) delete fItInputArray;
    226242  if(fDefinition) delete fDefinition;
     
    243259  Double_t rho = 0.0;
    244260  PseudoJet jet, area;
    245   vector<PseudoJet> inputList, outputList;
    246261  ClusterSequence *sequence;
    247   map< Double_t, Double_t >::iterator itEtaRangeMap;
     262  vector< PseudoJet > inputList, outputList;
     263  vector< PseudoJet >::iterator itInputList, itOutputList;
     264  vector< TEstimatorStruct >::iterator itEstimators;
    248265
    249266  DelphesFactory *factory = GetFactory();
     
    276293  if(fComputeRho && fAreaDefinition)
    277294  {
    278     for(itEtaRangeMap = fEtaRangeMap.begin(); itEtaRangeMap != fEtaRangeMap.end(); ++itEtaRangeMap)
     295    for(itEstimators = fEstimators.begin(); itEstimators != fEstimators.end(); ++itEstimators)
    279296    {
    280       Selector select_rapidity = SelectorAbsRapRange(itEtaRangeMap->first, itEtaRangeMap->second);
    281       JetMedianBackgroundEstimator estimator(select_rapidity, *fDefinition, *fAreaDefinition);
    282       estimator.set_particles(inputList);
    283       rho = estimator.rho();
     297      itEstimators->estimator->set_particles(inputList);
     298      rho = itEstimators->estimator->rho();
    284299
    285300      candidate = factory->NewCandidate();
    286301      candidate->Momentum.SetPtEtaPhiE(rho, 0.0, 0.0, rho);
    287       candidate->Edges[0] = itEtaRangeMap->first;
    288       candidate->Edges[1] = itEtaRangeMap->second;
     302      candidate->Edges[0] = itEstimators->etaMin;
     303      candidate->Edges[1] = itEstimators->etaMax;
    289304      fRhoOutputArray->Add(candidate);
    290305    }
     
    298313  detaMax = 0.0;
    299314  dphiMax = 0.0;
    300   vector<PseudoJet>::iterator itInputList, itOutputList;
    301315  for(itOutputList = outputList.begin(); itOutputList != outputList.end(); ++itOutputList)
    302316  {
     
    377391    }
    378392
    379 
    380393    fOutputArray->Add(candidate);
    381394  }
  • modules/FastJetFinder.h

    rd4b9697 r7278220  
    3030#include "classes/DelphesModule.h"
    3131
    32 #include <map>
     32#include <vector>
    3333
    3434class TObjArray;
     
    3838  class JetDefinition;
    3939  class AreaDefinition;
    40   class Selector;
     40  class JetMedianBackgroundEstimator;
    4141  namespace contrib {
    4242    class NjettinessPlugin;
     
    100100  Double_t fEffectiveRfact;
    101101
    102   std::map< Double_t, Double_t > fEtaRangeMap; //!
     102#if !defined(__CINT__) && !defined(__CLING__)
     103  struct TEstimatorStruct
     104  {
     105    fastjet::JetMedianBackgroundEstimator *estimator;
     106    Double_t etaMin, etaMax;
     107  };
     108
     109  std::vector< TEstimatorStruct > fEstimators; //!
     110#endif
    103111
    104112  TIterator *fItInputArray; //!
Note: See TracChangeset for help on using the changeset viewer.