- Timestamp:
- Dec 21, 2014, 11:04:36 AM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 1d1f6a4
- Parents:
- a740c66
- Location:
- modules
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/FastJetGridMedianEstimator.cc
ra740c66 r406b698 94 94 void FastJetGridMedianEstimator::Init() 95 95 { 96 // read eta ranges 96 ExRootConfParam param; 97 Long_t i, size; 98 Double_t drap, dphi, rapMin, rapMax; 97 99 98 ExRootConfParam param = GetParam("GridRange"); 99 Long_t i, size; 100 101 fGrid.clear(); 100 // read rapidity ranges 101 102 param = GetParam("GridRange"); 102 103 size = param.GetSize(); 104 105 fEstimators.clear(); 103 106 for(i = 0; i < size/4; ++i) 104 107 { 105 fGrid[make_pair(param[i*4].GetDouble(), param[i*4 + 1].GetDouble())] = make_pair(param[i*4 + 2].GetDouble(), param[i*4 + 3].GetDouble()); 106 //cout<<param[i*4].GetDouble()<<","<< param[i*4 + 1].GetDouble()<<","<< param[i*4 + 2].GetDouble()<<","<< param[i*4 + 3].GetDouble()<<endl; 108 rapMin = param[i*4].GetDouble(); 109 rapMax = param[i*4 + 1].GetDouble(); 110 drap = param[i*4 + 2].GetDouble(); 111 dphi = param[i*4 + 3].GetDouble(); 112 fEstimators.push_back(new GridMedianBackgroundEstimator(rapMin, rapMax, drap, dphi)); 113 } 107 114 108 } 109 110 111 //cout<<fGrid[make_pair(0.0,2.5)].first<<","<<fGrid[make_pair(0.0,2.5)].second<<endl; 112 113 // import input array 115 // import input array 114 116 115 117 fInputArray = ImportArray(GetString("InputArray", "Calorimeter/towers")); … … 117 119 118 120 fRhoOutputArray = ExportArray(GetString("RhoOutputArray", "rho")); 119 120 121 } 121 122 … … 124 125 void FastJetGridMedianEstimator::Finish() 125 126 { 127 vector< GridMedianBackgroundEstimator * >::iterator itEstimators; 128 129 for(itEstimators = fEstimators.begin(); itEstimators != fEstimators.end(); ++itEstimators) 130 { 131 if(*itEstimators) delete *itEstimators; 132 } 133 126 134 if(fItInputArray) delete fItInputArray; 127 135 } … … 133 141 Candidate *candidate; 134 142 TLorentzVector momentum; 135 Double_t deta, dphi, detaMin, detaMax;136 143 Int_t number; 137 144 Double_t rho = 0; 138 145 PseudoJet jet; 139 vector< PseudoJet> inputList, outputList;140 141 std::map< std::pair< Double_t , Double_t > , std::pair< Double_t , Double_t > >::iterator itGrid;142 146 vector< PseudoJet > inputList, outputList; 147 148 vector< GridMedianBackgroundEstimator * >::iterator itEstimators;; 149 143 150 DelphesFactory *factory = GetFactory(); 144 151 145 152 inputList.clear(); 146 153 147 154 // loop over input objects 148 155 fItInputArray->Reset(); … … 157 164 } 158 165 159 160 166 // compute rho and store it 161 162 // cout<<"caio"<<endl; 163 for(itGrid = fGrid.begin(); itGrid != fGrid.end(); ++itGrid) 167 168 for(itEstimators = fEstimators.begin(); itEstimators != fEstimators.end(); ++itEstimators) 164 169 { 165 //Selector select_rapidity = SelectorAbsRapRange(itEtaRangeMap->first, itEtaRangeMap->second); 166 // JetMedianBackgroundEstimator estimator(select_rapidity, *fDefinition, *fAreaDefinition); 167 168 //cout<<itGrid->first.first<<endl; 169 170 detaMin = (itGrid->first).first; 171 detaMax = (itGrid->first).second; 172 deta = (itGrid->second).first; 173 dphi = (itGrid->second).second; 174 175 //cout<<detaMin<<","<<detaMax<<","<<deta<<","<<dphi<<endl; 176 177 178 RectangularGrid grid(detaMin, detaMax, deta, dphi); 179 //cout<<grid.is_initialised()<<endl; 180 //cout<<grid.rapmin()<<","<<grid.rapmax()<<","<<grid.drap()<<","<<grid.dphi()<<endl; 181 182 GridMedianBackgroundEstimator estimator(grid); 183 184 estimator.set_particles(inputList); 185 186 //cout<<estimator.description()<<endl; 187 188 rho = estimator.rho(); 189 //cout<<rho<<endl; 170 (*itEstimators)->set_particles(inputList); 190 171 172 rho = (*itEstimators)->rho(); 191 173 192 174 candidate = factory->NewCandidate(); 193 175 candidate->Momentum.SetPtEtaPhiE(rho, 0.0, 0.0, rho); 194 candidate->Edges[0] = detaMin;195 candidate->Edges[1] = detaMax;176 candidate->Edges[0] = (*itEstimators)->rapmin(); 177 candidate->Edges[1] = (*itEstimators)->rapmax(); 196 178 fRhoOutputArray->Add(candidate); 197 179 } 198 199 180 } -
modules/FastJetGridMedianEstimator.h
ra740c66 r406b698 30 30 31 31 #include "classes/DelphesModule.h" 32 #include <map> 33 #include <utility> 34 32 #include <vector> 35 33 36 34 class TObjArray; … … 38 36 39 37 namespace fastjet { 40 class JetDefinition; 41 class AreaDefinition; 42 class Selector; 43 namespace contrib { 44 class NjettinessPlugin; 45 } 38 class GridMedianBackgroundEstimator; 46 39 } 47 40 … … 58 51 59 52 private: 60 61 typedef std::map< std::pair< Double_t , Double_t > , std::pair< Double_t , Double_t > > TGrid; //! 62 63 TGrid fGrid; //! 64 53 54 std::vector< fastjet::GridMedianBackgroundEstimator * > fEstimators; //! 55 65 56 TIterator *fItInputArray; //! 66 57
Note:
See TracChangeset
for help on using the changeset viewer.