- Timestamp:
- Dec 21, 2014, 9:37:54 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- b78adf8
- Parents:
- d4b9697
- Location:
- modules
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/FastJetFinder.cc
rd4b9697 r7278220 92 92 JetDefinition::Plugin *plugin = 0; 93 93 JetDefinition::Recombiner *recomb = 0; 94 NjettinessPlugin *njetPlugin = 0; 95 96 // read eta ranges 97 98 ExRootConfParam param = GetParam("RhoEtaRange"); 94 ExRootConfParam param; 99 95 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; 107 98 108 99 // define algorithm … … 197 188 break; 198 189 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); 201 192 break; 202 193 } … … 204 195 fPlugin = plugin; 205 196 fRecomb = recomb; 206 fNjettinessPlugin = njetPlugin;207 197 208 198 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 } 209 218 210 219 // import input array … … 223 232 void FastJetFinder::Finish() 224 233 { 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 225 241 if(fItInputArray) delete fItInputArray; 226 242 if(fDefinition) delete fDefinition; … … 243 259 Double_t rho = 0.0; 244 260 PseudoJet jet, area; 245 vector<PseudoJet> inputList, outputList;246 261 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; 248 265 249 266 DelphesFactory *factory = GetFactory(); … … 276 293 if(fComputeRho && fAreaDefinition) 277 294 { 278 for(itE taRangeMap = fEtaRangeMap.begin(); itEtaRangeMap != fEtaRangeMap.end(); ++itEtaRangeMap)295 for(itEstimators = fEstimators.begin(); itEstimators != fEstimators.end(); ++itEstimators) 279 296 { 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(); 284 299 285 300 candidate = factory->NewCandidate(); 286 301 candidate->Momentum.SetPtEtaPhiE(rho, 0.0, 0.0, rho); 287 candidate->Edges[0] = itE taRangeMap->first;288 candidate->Edges[1] = itE taRangeMap->second;302 candidate->Edges[0] = itEstimators->etaMin; 303 candidate->Edges[1] = itEstimators->etaMax; 289 304 fRhoOutputArray->Add(candidate); 290 305 } … … 298 313 detaMax = 0.0; 299 314 dphiMax = 0.0; 300 vector<PseudoJet>::iterator itInputList, itOutputList;301 315 for(itOutputList = outputList.begin(); itOutputList != outputList.end(); ++itOutputList) 302 316 { … … 377 391 } 378 392 379 380 393 fOutputArray->Add(candidate); 381 394 } -
modules/FastJetFinder.h
rd4b9697 r7278220 30 30 #include "classes/DelphesModule.h" 31 31 32 #include < map>32 #include <vector> 33 33 34 34 class TObjArray; … … 38 38 class JetDefinition; 39 39 class AreaDefinition; 40 class Selector;40 class JetMedianBackgroundEstimator; 41 41 namespace contrib { 42 42 class NjettinessPlugin; … … 100 100 Double_t fEffectiveRfact; 101 101 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 103 111 104 112 TIterator *fItInputArray; //!
Note:
See TracChangeset
for help on using the changeset viewer.