![]() |
![]() |
#include <RecoEgamma/EgammaHLTProducers/interface/EgammaHLTMulti5x5ClusterProducer.h>
Definition at line 23 of file EgammaHLTMulti5x5ClusterProducer.h.
EgammaHLTMulti5x5ClusterProducer::EgammaHLTMulti5x5ClusterProducer | ( | const edm::ParameterSet & | ps | ) |
Definition at line 42 of file EgammaHLTMulti5x5ClusterProducer.cc.
References barrelClusterCollection_, barrelHitCollection_, barrelHitProducer_, doBarrel_, doEndcaps_, doIsolated_, endcapClusterCollection_, endcapHitCollection_, endcapHitProducer_, edm::ParameterSet::getParameter(), l1LowerThr_, l1LowerThrIgnoreIsolation_, l1TagIsolated_, l1TagNonIsolated_, l1UpperThr_, Multi5x5_p, nEvt_, Multi5x5ClusterAlgo::pDEBUG, Multi5x5ClusterAlgo::pERROR, Multi5x5ClusterAlgo::pINFO, posCalculator_, Multi5x5ClusterAlgo::pWARNING, regionEtaMargin_, regionPhiMargin_, and verbosity.
00043 { 00044 // The verbosity level 00045 std::string verbosityString = ps.getParameter<std::string>("VerbosityLevel"); 00046 if (verbosityString == "DEBUG") verbosity = Multi5x5ClusterAlgo::pDEBUG; 00047 else if (verbosityString == "WARNING") verbosity = Multi5x5ClusterAlgo::pWARNING; 00048 else if (verbosityString == "INFO") verbosity = Multi5x5ClusterAlgo::pINFO; 00049 else verbosity = Multi5x5ClusterAlgo::pERROR; 00050 00051 doBarrel_ = ps.getParameter<bool>("doBarrel"); 00052 doEndcaps_ = ps.getParameter<bool>("doEndcaps"); 00053 doIsolated_ = ps.getParameter<bool>("doIsolated"); 00054 00055 // Parameters to identify the hit collections 00056 barrelHitProducer_ = ps.getParameter<edm::InputTag>("barrelHitProducer"); 00057 endcapHitProducer_ = ps.getParameter<edm::InputTag>("endcapHitProducer"); 00058 barrelHitCollection_ = ps.getParameter<std::string>("barrelHitCollection"); 00059 endcapHitCollection_ = ps.getParameter<std::string>("endcapHitCollection"); 00060 00061 // The names of the produced cluster collections 00062 barrelClusterCollection_ = ps.getParameter<std::string>("barrelClusterCollection"); 00063 endcapClusterCollection_ = ps.getParameter<std::string>("endcapClusterCollection"); 00064 00065 // Multi5x5 algorithm parameters 00066 double barrelSeedThreshold = ps.getParameter<double>("Multi5x5BarrelSeedThr"); 00067 double endcapSeedThreshold = ps.getParameter<double>("Multi5x5EndcapSeedThr"); 00068 00069 // L1 matching parameters 00070 l1TagIsolated_ = ps.getParameter< edm::InputTag > ("l1TagIsolated"); 00071 l1TagNonIsolated_ = ps.getParameter< edm::InputTag > ("l1TagNonIsolated"); 00072 l1LowerThr_ = ps.getParameter<double> ("l1LowerThr"); 00073 l1UpperThr_ = ps.getParameter<double> ("l1UpperThr"); 00074 l1LowerThrIgnoreIsolation_ = ps.getParameter<double> ("l1LowerThrIgnoreIsolation"); 00075 00076 regionEtaMargin_ = ps.getParameter<double>("regionEtaMargin"); 00077 regionPhiMargin_ = ps.getParameter<double>("regionPhiMargin"); 00078 00079 // Parameters for the position calculation: 00080 std::map<std::string,double> providedParameters; 00081 providedParameters.insert(std::make_pair("LogWeighted",ps.getParameter<bool>("posCalc_logweight"))); 00082 providedParameters.insert(std::make_pair("T0_barl",ps.getParameter<double>("posCalc_t0_barl"))); 00083 providedParameters.insert(std::make_pair("T0_endc",ps.getParameter<double>("posCalc_t0_endc"))); 00084 providedParameters.insert(std::make_pair("T0_endcPresh",ps.getParameter<double>("posCalc_t0_endcPresh"))); 00085 providedParameters.insert(std::make_pair("W0",ps.getParameter<double>("posCalc_w0"))); 00086 providedParameters.insert(std::make_pair("X0",ps.getParameter<double>("posCalc_x0"))); 00087 posCalculator_ = PositionCalc(providedParameters); 00088 00089 // Produces a collection of barrel and a collection of endcap clusters 00090 00091 produces< reco::BasicClusterCollection >(endcapClusterCollection_); 00092 produces< reco::BasicClusterCollection >(barrelClusterCollection_); 00093 00094 Multi5x5_p = new Multi5x5ClusterAlgo(barrelSeedThreshold, endcapSeedThreshold, posCalculator_,verbosity); 00095 00096 /* 00097 shapeAlgo_ = ClusterShapeAlgo(providedParameters);//new 00098 00099 00100 clustershapecollectionEB_ = ps.getParameter<std::string>("clustershapecollectionEB"); 00101 clustershapecollectionEE_ = ps.getParameter<std::string>("clustershapecollectionEE"); 00102 00103 //AssociationMap 00104 barrelClusterShapeAssociation_ = ps.getParameter<std::string>("barrelShapeAssociation"); 00105 endcapClusterShapeAssociation_ = ps.getParameter<std::string>("endcapShapeAssociation"); 00106 00107 // Produces a collection of barrel and a collection of endcap clusters 00108 00109 produces< reco::ClusterShapeCollection>(clustershapecollectionEE_);//new 00110 //produces< reco::BasicClusterCollection >(endcapClusterCollection_); 00111 produces< reco::ClusterShapeCollection>(clustershapecollectionEB_);//new 00112 // produces< reco::BasicClusterCollection >(barrelClusterCollection_); 00113 produces< reco::BasicClusterShapeAssociationCollection >(barrelClusterShapeAssociation_);//new 00114 produces< reco::BasicClusterShapeAssociationCollection >(endcapClusterShapeAssociation_);//new 00115 00116 */ 00117 00118 nEvt_ = 0; 00119 }
EgammaHLTMulti5x5ClusterProducer::~EgammaHLTMulti5x5ClusterProducer | ( | ) |
Definition at line 122 of file EgammaHLTMulti5x5ClusterProducer.cc.
References Multi5x5_p.
00123 { 00124 delete Multi5x5_p; 00125 }
void EgammaHLTMulti5x5ClusterProducer::clusterizeECALPart | ( | edm::Event & | evt, | |
const edm::EventSetup & | es, | |||
const std::string & | hitProducer, | |||
const std::string & | hitCollection, | |||
const std::string & | clusterCollection, | |||
const std::vector< EcalEtaPhiRegion > & | regions, | |||
const Multi5x5ClusterAlgo::EcalPart & | ecalPart | |||
) | [private] |
Definition at line 278 of file EgammaHLTMulti5x5ClusterProducer.cc.
References Multi5x5ClusterAlgo::barrel, barrelClusterCollection_, DetId::Ecal, EcalBarrel, EcalEndcap, EcalPreshower, endcapClusterCollection_, edm::EventSetup::get(), getCollection(), Multi5x5ClusterAlgo::makeClusters(), Multi5x5_p, and edm::Event::put().
Referenced by produce().
00284 { 00285 00286 // get the hit collection from the event: 00287 const EcalRecHitCollection *hitCollection_p = getCollection(evt, hitProducer, hitCollection); 00288 00289 // get the geometry and topology from the event setup: 00290 edm::ESHandle<CaloGeometry> geoHandle; 00291 es.get<CaloGeometryRecord>().get(geoHandle); 00292 00293 const CaloSubdetectorGeometry *geometry_p; 00294 CaloSubdetectorTopology *topology_p; 00295 00296 if (ecalPart == Multi5x5ClusterAlgo::barrel) 00297 { 00298 geometry_p = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalBarrel); 00299 topology_p = new EcalBarrelTopology(geoHandle); 00300 } 00301 else 00302 { 00303 geometry_p = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalEndcap); 00304 topology_p = new EcalEndcapTopology(geoHandle); 00305 } 00306 00307 00308 const CaloSubdetectorGeometry *geometryES_p; 00309 geometryES_p = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalPreshower); 00310 00311 // Run the clusterization algorithm: 00312 reco::BasicClusterCollection clusters; 00313 clusters = Multi5x5_p->makeClusters(hitCollection_p, geometry_p, topology_p, geometryES_p, ecalPart, true, regions); 00314 00315 // create an auto_ptr to a BasicClusterCollection, copy the barrel clusters into it and put in the Event: 00316 std::auto_ptr< reco::BasicClusterCollection > clusters_p(new reco::BasicClusterCollection); 00317 clusters_p->assign(clusters.begin(), clusters.end()); 00318 edm::OrphanHandle<reco::BasicClusterCollection> bccHandle; 00319 if (ecalPart == Multi5x5ClusterAlgo::barrel) 00320 bccHandle = evt.put(clusters_p, barrelClusterCollection_); 00321 else 00322 bccHandle = evt.put(clusters_p, endcapClusterCollection_); 00323 00324 delete topology_p; 00325 }
bool EgammaHLTMulti5x5ClusterProducer::counterExceeded | ( | ) | const [inline, private] |
Definition at line 73 of file EgammaHLTMulti5x5ClusterProducer.h.
References nEvt_, and nMaxPrintout_.
00073 { return ((nEvt_ > nMaxPrintout_) || (nMaxPrintout_ < 0)); }
const EcalRecHitCollection * EgammaHLTMulti5x5ClusterProducer::getCollection | ( | edm::Event & | evt, | |
const std::string & | hitProducer_, | |||
const std::string & | hitCollection_ | |||
) | [private] |
Definition at line 261 of file EgammaHLTMulti5x5ClusterProducer.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), edm::Event::getByLabel(), edm::Handle< T >::isValid(), and edm::Handle< T >::product().
Referenced by clusterizeECALPart().
00264 { 00265 edm::Handle<EcalRecHitCollection> rhcHandle; 00266 00267 evt.getByLabel(hitProducer_, hitCollection_, rhcHandle); 00268 if (!(rhcHandle.isValid())) 00269 { 00270 std::cout << "could not get a handle on the EcalRecHitCollection!" << std::endl; 00271 edm::LogError("EgammaHLTMulti5x5ClusterProducerError") << "Error! can't get the product " << hitCollection_.c_str() ; 00272 return 0; 00273 } 00274 return rhcHandle.product(); 00275 }
void EgammaHLTMulti5x5ClusterProducer::outputValidationInfo | ( | reco::BasicClusterRefVector & | clusterRefVector | ) | [private] |
void EgammaHLTMulti5x5ClusterProducer::produce | ( | edm::Event & | evt, | |
const edm::EventSetup & | es | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 128 of file EgammaHLTMulti5x5ClusterProducer.cc.
References Multi5x5ClusterAlgo::barrel, barrelClusterCollection_, barrelHitCollection_, barrelHitProducer_, clusterizeECALPart(), doBarrel_, doEndcaps_, doIsolated_, Multi5x5ClusterAlgo::endcap, endcapClusterCollection_, endcapHitCollection_, endcapHitProducer_, edm::EventSetup::get(), edm::Event::getByLabel(), l1LowerThr_, l1LowerThrIgnoreIsolation_, l1TagIsolated_, l1TagNonIsolated_, l1UpperThr_, edm::InputTag::label(), nEvt_, regionEtaMargin_, and regionPhiMargin_.
00129 { 00130 //Get the L1 EM Particle Collection 00131 edm::Handle< l1extra::L1EmParticleCollection > emIsolColl ; 00132 if(doIsolated_) 00133 evt.getByLabel(l1TagIsolated_, emIsolColl); 00134 //Get the L1 EM Particle Collection 00135 edm::Handle< l1extra::L1EmParticleCollection > emNonIsolColl ; 00136 evt.getByLabel(l1TagNonIsolated_, emNonIsolColl); 00137 // Get the CaloGeometry 00138 edm::ESHandle<L1CaloGeometry> l1CaloGeom ; 00139 es.get<L1CaloGeometryRecord>().get(l1CaloGeom) ; 00140 00141 std::vector<EcalEtaPhiRegion> barrelRegions; 00142 std::vector<EcalEtaPhiRegion> endcapRegions; 00143 00144 if(doIsolated_) { 00145 for( l1extra::L1EmParticleCollection::const_iterator emItr = emIsolColl->begin(); emItr != emIsolColl->end() ;++emItr ){ 00146 00147 if (emItr->et() > l1LowerThr_ && emItr->et() < l1UpperThr_) { 00148 00149 // Access the GCT hardware object corresponding to the L1Extra EM object. 00150 int etaIndex = emItr->gctEmCand()->etaIndex() ; 00151 00152 00153 int phiIndex = emItr->gctEmCand()->phiIndex() ; 00154 // Use the L1CaloGeometry to find the eta, phi bin boundaries. 00155 double etaLow = l1CaloGeom->etaBinLowEdge( etaIndex ) ; 00156 double etaHigh = l1CaloGeom->etaBinHighEdge( etaIndex ) ; 00157 double phiLow = l1CaloGeom->emJetPhiBinLowEdge( phiIndex ) ; 00158 double phiHigh = l1CaloGeom->emJetPhiBinHighEdge( phiIndex ) ; 00159 00160 //Attention isForward does not work 00161 int isforw=0; 00162 int isbarl=0; 00163 if((float)(etaHigh)>1.479 || (float)(etaLow)<-1.479) isforw=1; 00164 if(((float)(etaLow)>-1.479 && (float)(etaLow)<1.479) || 00165 ((float)(etaHigh)>-1.479 && (float)(etaHigh)<1.479)) isbarl=1; 00166 00167 //std::cout<<"Multi5x5 etaindex "<<etaIndex<<" low hig : "<<etaLow<<" "<<etaHigh<<" phi low hig" <<phiLow<<" " << phiHigh<<" isforw "<<emItr->gctEmCand()->regionId().isForward()<<" isforwnew" <<isforw<< std::endl; 00168 00169 etaLow -= regionEtaMargin_; 00170 etaHigh += regionEtaMargin_; 00171 phiLow -= regionPhiMargin_; 00172 phiHigh += regionPhiMargin_; 00173 00174 //if (emItr->gctEmCand()->regionId().isForward()) { 00175 if (isforw) { 00176 if (etaHigh>-1.479 && etaHigh<1.479) etaHigh=-1.479; 00177 if ( etaLow>-1.479 && etaLow<1.479) etaLow=1.479; 00178 EcalEtaPhiRegion region(etaLow,etaHigh,phiLow,phiHigh); 00179 endcapRegions.push_back(region); 00180 } 00181 if (isbarl) { 00182 if (etaHigh>1.479) etaHigh=1.479; 00183 if (etaLow<-1.479) etaLow=-1.479; 00184 EcalEtaPhiRegion region(etaLow,etaHigh,phiLow,phiHigh); 00185 barrelRegions.push_back(region); 00186 } 00187 EcalEtaPhiRegion region(etaLow,etaHigh,phiLow,phiHigh); 00188 00189 } 00190 } 00191 } 00192 00193 00194 if(!doIsolated_||l1LowerThrIgnoreIsolation_<64) { 00195 for( l1extra::L1EmParticleCollection::const_iterator emItr = emNonIsolColl->begin(); emItr != emNonIsolColl->end() ;++emItr ){ 00196 00197 if(doIsolated_&&emItr->et()<l1LowerThrIgnoreIsolation_) continue; 00198 00199 if (emItr->et() > l1LowerThr_ && emItr->et() < l1UpperThr_) { 00200 00201 // Access the GCT hardware object corresponding to the L1Extra EM object. 00202 int etaIndex = emItr->gctEmCand()->etaIndex() ; 00203 00204 00205 int phiIndex = emItr->gctEmCand()->phiIndex() ; 00206 // Use the L1CaloGeometry to find the eta, phi bin boundaries. 00207 double etaLow = l1CaloGeom->etaBinLowEdge( etaIndex ) ; 00208 double etaHigh = l1CaloGeom->etaBinHighEdge( etaIndex ) ; 00209 double phiLow = l1CaloGeom->emJetPhiBinLowEdge( phiIndex ) ; 00210 double phiHigh = l1CaloGeom->emJetPhiBinHighEdge( phiIndex ) ; 00211 00212 00213 int isforw=0; 00214 int isbarl=0; 00215 if((float)(etaHigh)>1.479 || (float)(etaLow)<-1.479) isforw=1; 00216 if(((float)(etaLow)>-1.479 && (float)(etaLow)<1.479) || 00217 ((float)(etaHigh)>-1.479 && (float)(etaHigh)<1.479)) isbarl=1; 00218 00219 //std::cout<<"Multi5x5 etaindex "<<etaIndex<<" low hig : "<<etaLow<<" "<<etaHigh<<" phi low hig" <<phiLow<<" " << phiHigh<<" isforw "<<emItr->gctEmCand()->regionId().isForward()<<" isforwnew" <<isforw<< std::endl; 00220 00221 etaLow -= regionEtaMargin_; 00222 etaHigh += regionEtaMargin_; 00223 phiLow -= regionPhiMargin_; 00224 phiHigh += regionPhiMargin_; 00225 00226 //if (emItr->gctEmCand()->regionId().isForward()) { 00227 if (isforw) { 00228 if (etaHigh>-1.479 && etaHigh<1.479) etaHigh=-1.479; 00229 if ( etaLow>-1.479 && etaLow<1.479) etaLow=1.479; 00230 EcalEtaPhiRegion region(etaLow,etaHigh,phiLow,phiHigh); 00231 endcapRegions.push_back(region); 00232 } 00233 if (isbarl) { 00234 if (etaHigh>1.479) etaHigh=1.479; 00235 if (etaLow<-1.479) etaLow=-1.479; 00236 EcalEtaPhiRegion region(etaLow,etaHigh,phiLow,phiHigh); 00237 barrelRegions.push_back(region); 00238 } 00239 00240 } 00241 } 00242 } 00243 00244 00245 if (doEndcaps_ 00246 //&&endcapRegions.size()!=0 00247 ) { 00248 00249 clusterizeECALPart(evt, es, endcapHitProducer_.label(), endcapHitCollection_, endcapClusterCollection_, endcapRegions, Multi5x5ClusterAlgo::endcap);//old 00250 } 00251 if (doBarrel_ 00252 //&& barrelRegions.size()!=0 00253 ) { 00254 clusterizeECALPart(evt, es, barrelHitProducer_.label(), barrelHitCollection_, barrelClusterCollection_, barrelRegions, Multi5x5ClusterAlgo::barrel);//old 00255 00256 } 00257 nEvt_++; 00258 }
std::string EgammaHLTMulti5x5ClusterProducer::barrelClusterCollection_ [private] |
Definition at line 49 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by clusterizeECALPart(), EgammaHLTMulti5x5ClusterProducer(), and produce().
std::string EgammaHLTMulti5x5ClusterProducer::barrelHitCollection_ [private] |
Definition at line 46 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer(), and produce().
Definition at line 44 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer(), and produce().
Definition at line 40 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer(), and produce().
Definition at line 41 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer(), and produce().
Definition at line 42 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer(), and produce().
std::string EgammaHLTMulti5x5ClusterProducer::endcapClusterCollection_ [private] |
Definition at line 50 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by clusterizeECALPart(), EgammaHLTMulti5x5ClusterProducer(), and produce().
std::string EgammaHLTMulti5x5ClusterProducer::endcapHitCollection_ [private] |
Definition at line 47 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer(), and produce().
Definition at line 45 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer(), and produce().
double EgammaHLTMulti5x5ClusterProducer::l1LowerThr_ [private] |
Definition at line 62 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer(), and produce().
double EgammaHLTMulti5x5ClusterProducer::l1LowerThrIgnoreIsolation_ [private] |
Definition at line 64 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer(), and produce().
Definition at line 60 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer(), and produce().
Definition at line 61 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer(), and produce().
double EgammaHLTMulti5x5ClusterProducer::l1UpperThr_ [private] |
Definition at line 63 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer(), and produce().
Definition at line 70 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by clusterizeECALPart(), EgammaHLTMulti5x5ClusterProducer(), and ~EgammaHLTMulti5x5ClusterProducer().
int EgammaHLTMulti5x5ClusterProducer::nEvt_ [private] |
Definition at line 36 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by counterExceeded(), EgammaHLTMulti5x5ClusterProducer(), and produce().
Definition at line 69 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer().
double EgammaHLTMulti5x5ClusterProducer::regionEtaMargin_ [private] |
Definition at line 66 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer(), and produce().
double EgammaHLTMulti5x5ClusterProducer::regionPhiMargin_ [private] |
Definition at line 67 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer(), and produce().
Definition at line 38 of file EgammaHLTMulti5x5ClusterProducer.h.
Referenced by EgammaHLTMulti5x5ClusterProducer().