CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
UnifiedSCCollectionProducer Class Reference

#include <UnifiedSCCollectionProducer.h>

Inheritance diagram for UnifiedSCCollectionProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 
 UnifiedSCCollectionProducer (const edm::ParameterSet &ps)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

std::string bcCollection_
 
std::string bcCollectionUncleanOnly_
 
edm::EDGetTokenT< reco::BasicClusterCollectioncleanBcCollection_
 
edm::EDGetTokenT< reco::SuperClusterCollectioncleanScCollection_
 
std::string scCollection_
 
std::string scCollectionUncleanOnly_
 
edm::EDGetTokenT< reco::BasicClusterCollectionuncleanBcCollection_
 
edm::EDGetTokenT< reco::SuperClusterCollectionuncleanScCollection_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 18 of file UnifiedSCCollectionProducer.h.

Constructor & Destructor Documentation

UnifiedSCCollectionProducer::UnifiedSCCollectionProducer ( const edm::ParameterSet ps)

Definition at line 53 of file UnifiedSCCollectionProducer.cc.

References bcCollection_, bcCollectionUncleanOnly_, cleanBcCollection_, cleanScCollection_, edm::ParameterSet::getParameter(), scCollection_, scCollectionUncleanOnly_, AlCaHLTBitMon_QueryRunRegistry::string, uncleanBcCollection_, and uncleanScCollection_.

54 {
57  // get the parameters
58  // the cleaned collection:
60  consumes<BasicClusterCollection>(ps.getParameter<edm::InputTag>("cleanBcCollection"));
62  consumes<SuperClusterCollection>(ps.getParameter<edm::InputTag>("cleanScCollection"));
63 
64  // the uncleaned collection
66  consumes<BasicClusterCollection>(ps.getParameter<edm::InputTag>("uncleanBcCollection"));
68  consumes<SuperClusterCollection>(ps.getParameter<edm::InputTag>("uncleanScCollection"));
69 
70  // the names of the products to be produced:
71  //
72  // the clean collection: this is as it was before, but labeled
73  bcCollection_ = ps.getParameter<std::string>("bcCollection");
74  scCollection_ = ps.getParameter<std::string>("scCollection");
75  // the unclean only collection: SC unique to the unclean collection
76  bcCollectionUncleanOnly_ = ps.getParameter<std::string>("bcCollectionUncleanOnly");
77  scCollectionUncleanOnly_ = ps.getParameter<std::string>("scCollectionUncleanOnly");
78  // the products:
79  produces< reco::BasicClusterCollection >(bcCollection_);
80  produces< reco::SuperClusterCollection >(scCollection_);
81  produces< reco::BasicClusterCollection >(bcCollectionUncleanOnly_);
82  produces< reco::SuperClusterCollection >(scCollectionUncleanOnly_);
83 
84 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::SuperClusterCollection > uncleanScCollection_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
edm::EDGetTokenT< reco::BasicClusterCollection > uncleanBcCollection_
edm::EDGetTokenT< reco::SuperClusterCollection > cleanScCollection_
edm::EDGetTokenT< reco::BasicClusterCollection > cleanBcCollection_
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects

Member Function Documentation

void UnifiedSCCollectionProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 88 of file UnifiedSCCollectionProducer.cc.

References bcCollection_, bcCollectionUncleanOnly_, cleanBcCollection_, reco::CaloCluster::cleanOnly, cleanScCollection_, reco::CaloCluster::common, reco::CaloCluster::energy(), reco::CaloCluster::eta(), plotBeamSpotDB::first, edm::Event::getByToken(), mps_fire::i, createfilelist::int, reco::CaloCluster::isInClean(), reco::CaloCluster::isInUnclean(), edm::OrphanHandleBase::isValid(), LogTrace, eostools::move(), edm::PtrVector< T >::push_back(), edm::Event::put(), scCollection_, scCollectionUncleanOnly_, reco::SuperCluster::seed(), SurveyInfoScenario_cff::seed, reco::CaloCluster::setFlags(), funct::true, uncleanBcCollection_, reco::CaloCluster::uncleanOnly, and uncleanScCollection_.

90 {
91 
92  edm::LogInfo("UnifiedSC")<< ">>>>> Entering UnifiedSCCollectionProducer <<<<<";
93  // get the input collections
94  // __________________________________________________________________________
95  //
96  // cluster collections:
99  //
102 
103  evt.getByToken(cleanScCollection_, pCleanSC);
104  evt.getByToken(cleanBcCollection_, pCleanBC);
105  evt.getByToken(uncleanBcCollection_, pUncleanBC);
106  evt.getByToken(uncleanScCollection_, pUncleanSC);
107 
108  // the collections to be produced ___________________________________________
109  reco::BasicClusterCollection basicClusters;
110  reco::SuperClusterCollection superClusters;
111  //
112  reco::BasicClusterCollection basicClustersUncleanOnly;
113  reco::SuperClusterCollection superClustersUncleanOnly;
114  //
115  // run over the uncleaned SC and check how many of them are matched to
116  // the cleaned ones
117  // if you find a matched one, then keep the info that it is matched
118  // along with which clean SC was matched + its basic clusters
119  // if you find an unmatched one, keep the info and store its basic clusters
120  //
121  //
122  int uncleanSize = pUncleanSC->size();
123  int cleanSize = pCleanSC->size();
124 
125  LogTrace("UnifiedSC") << "Size of Clean Collection: " << cleanSize
126  << ", uncleanSize: " << uncleanSize;
127 
128 
129  // keep the indices
130  std::vector<int> inUncleanOnlyInd; // counting the unclean
131  std::vector<int> inCleanInd; // counting the unclean
132  std::vector<int> inCleanOnlyInd; // counting the clean
133  std::vector<DetId> scUncleanSeedDetId; // counting the unclean
134  std::vector<DetId> scCleanSeedDetId; // counting the clean
135  // ontains the index of the SC that owns that BS
136  // first basic cluster index, second: 0 for unclean and 1 for clean
137  std::vector< std::pair<int, int> > basicClusterOwner;
138  std::vector< std::pair<int, int> > basicClusterOwnerUncleanOnly;
139  // if this basic cluster is a seed it is 1
140  std::vector<int> uncleanBasicClusterIsSeed;
141 
142  // loop over unclean SC _____________________________________________________
143  for (int isc =0; isc< uncleanSize; ++isc) {
144  reco::SuperClusterRef unscRef( pUncleanSC, isc);
145  const std::vector< std::pair<DetId, float> > & uhits = unscRef->hitsAndFractions();
146  int uhitsSize = uhits.size();
147  bool foundTheSame = false;
148  for (int jsc=0; jsc < cleanSize; ++jsc) { // loop over the cleaned SC
149  reco::SuperClusterRef cscRef( pCleanSC, jsc );
150  const std::vector<std::pair<DetId,float> > & chits = cscRef->hitsAndFractions();
151  int chitsSize = chits.size();
152  foundTheSame = false;
153  if (unscRef->seed()->seed()==cscRef->seed()->seed() && chitsSize == uhitsSize) {
154  // if the clusters are exactly the same then because the clustering
155  // algorithm works in a deterministic way, the order of the rechits
156  // will be the same
157  foundTheSame = true;
158  for (int i=0; i< chitsSize; ++i) {
159  if (uhits[i].first != chits[i].first ) {
160  foundTheSame=false;
161  break;
162  }
163  }
164 
165  }
166  if (foundTheSame) { // ok you have found it:
167  // this supercluster belongs to both collections
168  inUncleanOnlyInd.push_back(0);
169  inCleanInd.push_back(jsc); // keeps the index of the clean SC
170  scUncleanSeedDetId.push_back(unscRef->seed()->seed());
171  //
172  // keep its basic clusters:
173  for (reco::CaloCluster_iterator bciter = unscRef->clustersBegin(); bciter != unscRef->clustersEnd(); ++bciter) {
174  // the basic clusters
175  basicClusters.push_back(**bciter);
176  // index of the unclean SC
177  basicClusterOwner.push_back( std::make_pair(isc,0) );
178  }
179  break; // break the loop over unclean sc
180  }
181  }
182  if (not foundTheSame) { // this SC is only in the unclean collection
183  // mark it as unique in the uncleaned
184  inUncleanOnlyInd.push_back(1);
185  scUncleanSeedDetId.push_back(unscRef->seed()->seed());
186  // keep all its basic clusters
187  for (reco::CaloCluster_iterator bciter = unscRef->clustersBegin(); bciter != unscRef->clustersEnd(); ++bciter) {
188  // the basic clusters
189  basicClustersUncleanOnly.push_back(**bciter);
190  basicClusterOwnerUncleanOnly.push_back( std::make_pair(isc,0) );
191  }
192  }
193  } // loop over the unclean SC _______________________________________________
194  //
195  int inCleanSize = inCleanInd.size();
196  //
197  // loop over the clean SC, check that are not in common with the unclean
198  // ones and then store their SC as before ___________________________________
199  for (int jsc =0; jsc< cleanSize; ++jsc) {
200  // check whether this index is already in the common collection
201  bool takenAlready = false;
202  for (int j=0; j< inCleanSize; ++j) {
203  if (jsc == inCleanInd[j]) { takenAlready = true ;break;}
204  }
205  if (takenAlready) {
206  inCleanOnlyInd.push_back(0);
207  scCleanSeedDetId.push_back(DetId(0));
208  continue;
209  }
210  inCleanOnlyInd.push_back(1);
211  reco::SuperClusterRef cscRef( pCleanSC, jsc );
212  scCleanSeedDetId.push_back(cscRef->seed()->seed());
213  for (reco::CaloCluster_iterator bciter = cscRef->clustersBegin(); bciter != cscRef->clustersEnd(); ++bciter) {
214  // the basic clusters
215  basicClusters.push_back(**bciter);
216  basicClusterOwner.push_back( std::make_pair(jsc,1) );
217  }
218  } // end loop over clean SC _________________________________________________
219  //
220  //
221 
222  // Final check: in the endcap BC may exist that are not associated to SC,
223  // we need to recover them as well (e.g. multi5x5 algo)
224  // This is should be optimized (SA, 20110621)
225 
226 
227  // loop on original clean BC collection and see if the BC is missing from the new one
228  for (reco::BasicClusterCollection::const_iterator bc = pCleanBC->begin();
229  bc!=pCleanBC->end();
230  ++bc){
231 
232  bool foundTheSame = false;
233  for (reco::BasicClusterCollection::const_iterator cleanonly_bc = basicClusters.begin();
234  cleanonly_bc!=basicClusters.end();
235  ++cleanonly_bc){
236 
237  const std::vector<std::pair<DetId,float> > & chits = bc->hitsAndFractions();
238  int chitsSize = chits.size();
239 
240  const std::vector<std::pair<DetId,float> > & uhits = cleanonly_bc->hitsAndFractions();
241  int uhitsSize = uhits.size();
242 
243 
244  if (cleanonly_bc->seed()==bc->seed() && chitsSize == uhitsSize) {
245  foundTheSame = true;
246  for (int i=0; i< chitsSize; ++i) {
247  if (uhits[i].first != chits[i].first ) {
248  foundTheSame=false;
249  break;
250  }
251  }
252  }
253 
254  } // loop on new clean BC collection
255 
256  // clean basic cluster is not associated to SC and does not belong to the
257  // new collection, add it
258  if (!foundTheSame){
259  basicClusters.push_back(*bc);
260  LogTrace("UnifiedSC")<<"found BC to add that was not associated to any SC";
261  }
262 
263  } // loop on original clean BC collection
264 
265 
266  // at this point we have the basic cluster collection ready
267  // Up to index basicClusterOwner.size() we have the BC owned by a SC
268  // The remaining are BCs not owned by a SC
269 
270  int bcSize = (int) basicClusterOwner.size();
271  int bcSizeUncleanOnly = (int) basicClustersUncleanOnly.size();
272 
273  LogTrace("UnifiedSC") << "Found cleaned SC: " << cleanSize
274  << " uncleaned SC: " << uncleanSize ;
275  //
276  // export the clusters to the event from the clean clusters
277  auto basicClusters_p = std::make_unique<reco::BasicClusterCollection>();
278  basicClusters_p->assign(basicClusters.begin(), basicClusters.end());
280  evt.put(std::move(basicClusters_p), bcCollection_);
281  if (!(bccHandle.isValid())) {
282 
283  edm::LogWarning("MissingInput")<< "could not handle the new BasicClusters!";
284  return;
285  }
286  reco::BasicClusterCollection basicClustersProd = *bccHandle;
287 
288  LogTrace("UnifiedSC")<< "Got the BasicClusters from the event again" ;
289  //
290  // export the clusters to the event: from the unclean only clusters
291  auto basicClustersUncleanOnly_p = std::make_unique<reco::BasicClusterCollection>();
292  basicClustersUncleanOnly_p->assign(basicClustersUncleanOnly.begin(),
293  basicClustersUncleanOnly.end());
295  evt.put(std::move(basicClustersUncleanOnly_p), bcCollectionUncleanOnly_);
296  if (!(bccHandleUncleanOnly.isValid())) {
297 
298  edm::LogWarning("MissingInput")<< "could not handle the new BasicClusters (Unclean Only)!" ;
299  return;
300  }
301  reco::BasicClusterCollection basicClustersUncleanOnlyProd = *bccHandleUncleanOnly;
302  LogTrace("UnifiedSC")<< "Got the BasicClusters from the event again (Unclean Only)" ;
303  //
304 
305  // now we can build the SC collection
306  //
307  // start again from the unclean collection
308  // all the unclean SC will become members of the new collection
309  // with different algoIDs ___________________________________________________
310  for (int isc=0; isc< uncleanSize; ++isc) {
311  reco::CaloClusterPtrVector clusterPtrVector;
312  // the seed is the basic cluster with the highest energy
314  if (inUncleanOnlyInd[isc] == 1) { // unclean SC Unique in Unclean
315  for (int jbc=0; jbc< bcSizeUncleanOnly; ++jbc) {
316  std::pair<int, int> theBcOwner = basicClusterOwnerUncleanOnly[jbc];
317  if (theBcOwner.first == isc && theBcOwner.second == 0) {
318  reco::CaloClusterPtr currentClu=reco::CaloClusterPtr(bccHandleUncleanOnly,jbc);
319  clusterPtrVector.push_back(currentClu);
320  if (scUncleanSeedDetId[isc] == currentClu->seed()) {
321  seed = currentClu;
322  }
323  }
324  }
325 
326  }
327  else { // unclean SC common in clean and unclean
328  for (int jbc=0; jbc< bcSize; ++jbc) {
329  std::pair<int, int> theBcOwner = basicClusterOwner[jbc];
330  if (theBcOwner.first == isc && theBcOwner.second == 0) {
331  reco::CaloClusterPtr currentClu=reco::CaloClusterPtr(bccHandle,jbc);
332  clusterPtrVector.push_back(currentClu);
333  if (scUncleanSeedDetId[isc] == currentClu->seed()) {
334  seed = currentClu;
335  }
336  }
337  }
338  }
339  //std::cout << "before getting the uncl" << std::endl;
340  reco::SuperClusterRef unscRef( pUncleanSC, isc );
341  reco::SuperCluster newSC(unscRef->energy(), unscRef->position(),
342  seed, clusterPtrVector );
343  // now set the algoID for this SC again
344  if (inUncleanOnlyInd[isc] == 1) {
345  // set up the quality to unclean only .............
347  superClustersUncleanOnly.push_back(newSC);
348  }
349  else {
350  // set up the quality to common .............
351  newSC.setFlags(reco::CaloCluster::common);
352  superClusters.push_back(newSC);
353  }
354  // now you can store your SC
355 
356  } // end loop over unclean SC _______________________________________________
357  // flags numbering scheme
358  // flags = 0 = cleanedOnly cluster is only in the cleaned collection
359  // flags = 100 = common cluster is common in both collections
360  // flags = 200 = uncleanedOnly cluster is only in the uncleaned collection
361 
362  // now loop over the clean SC and do the same but now you have to avoid the
363  // the duplicated ones ______________________________________________________
364  for (int jsc=0; jsc< cleanSize; ++jsc) {
365  //std::cout << "working in cl #" << jsc << std::endl;
366  // check that the SC is not in the unclean collection
367  if (inCleanOnlyInd[jsc] == 0) continue;
368  reco::CaloClusterPtrVector clusterPtrVector;
369  // the seed is the basic cluster with the highest energy
371  for (int jbc=0; jbc< bcSize; ++jbc) {
372  std::pair<int, int> theBcOwner = basicClusterOwner[jbc];
373  if (theBcOwner.first == jsc && theBcOwner.second == 1) {
374  reco::CaloClusterPtr currentClu=reco::CaloClusterPtr(bccHandle,jbc);
375  clusterPtrVector.push_back(currentClu);
376  if (scCleanSeedDetId[jsc] == currentClu->seed()) {
377  seed = currentClu;
378  }
379  }
380  }
381  reco::SuperClusterRef cscRef( pCleanSC, jsc );
382  reco::SuperCluster newSC(cscRef->energy(), cscRef->position(),
383  seed, clusterPtrVector );
385 
386  // add it to the collection:
387  superClusters.push_back(newSC);
388 
389  } // end loop over clean SC _________________________________________________
390 
391 
392 
393 
394 
395 
396 
397  LogTrace("UnifiedSC")<< "New SC collection was created";
398 
399  auto superClusters_p = std::make_unique<reco::SuperClusterCollection>();
400  superClusters_p->assign(superClusters.begin(), superClusters.end());
401 
402  evt.put(std::move(superClusters_p), scCollection_);
403 
404  LogTrace("UnifiedSC") << "Clusters (Basic/Super) added to the Event! :-)";
405 
406  auto superClustersUncleanOnly_p = std::make_unique<reco::SuperClusterCollection>();
407  superClustersUncleanOnly_p->assign(superClustersUncleanOnly.begin(),
408  superClustersUncleanOnly.end());
409 
410  evt.put(std::move(superClustersUncleanOnly_p), scCollectionUncleanOnly_);
411 
412  // ----- debugging ----------
413  // print the new collection SC quantities
414 
415  // print out the clean collection SC
416  LogTrace("UnifiedSC") << "Clean Collection SC ";
417  for (int i=0; i < cleanSize; ++i) {
418  reco::SuperClusterRef cscRef( pCleanSC, i );
419  LogTrace("UnifiedSC") << " >>> clean #" << i << "; Energy: " << cscRef->energy()
420  << " eta: " << cscRef->eta()
421  << " sc seed detid: " << cscRef->seed()->seed().rawId()
422  << std::endl;
423  }
424  // the unclean SC
425  LogTrace("UnifiedSC") << "Unclean Collection SC ";
426  for (int i=0; i < uncleanSize; ++i) {
427  reco::SuperClusterRef uscRef( pUncleanSC, i );
428  LogTrace("UnifiedSC") << " >>> unclean #" << i << "; Energy: " << uscRef->energy()
429  << " eta: " << uscRef->eta()
430  << " sc seed detid: " << uscRef->seed()->seed().rawId();
431  }
432  // the new collection
433  LogTrace("UnifiedSC")<< "The new SC clean collection with size "<< superClusters.size() << std::endl;
434 
435  int new_unclean = 0, new_clean=0;
436  for (int i=0; i < (int) superClusters.size(); ++i) {
437  const reco::SuperCluster & nsc = superClusters[i];
438  LogTrace("UnifiedSC") << "SC was got" << std::endl
439  << " ---> energy: " << nsc.energy() << std::endl
440  << " ---> eta: " << nsc.eta() << std::endl
441  << " ---> inClean: " << nsc.isInClean() << std::endl
442  << " ---> id: " << nsc.seed()->seed().rawId() << std::endl
443  << " >>> newSC #" << i << "; Energy: " << nsc.energy()
444  << " eta: " << nsc.eta() << " isClean="
445  << nsc.isInClean() << " isUnclean=" << nsc.isInUnclean()
446  << " sc seed detid: " << nsc.seed()->seed().rawId();
447 
448  if (nsc.isInUnclean()) ++new_unclean;
449  if (nsc.isInClean()) ++new_clean;
450  }
451  LogTrace("UnifiedSC")<< "The new SC unclean only collection with size "<< superClustersUncleanOnly.size();
452  for (int i=0; i < (int) superClustersUncleanOnly.size(); ++i) {
453  const reco::SuperCluster nsc = superClustersUncleanOnly[i];
454  LogTrace ("UnifiedSC") << " >>> newSC #" << i << "; Energy: " << nsc.energy()
455  << " eta: " << nsc.eta() << " isClean="
456  << nsc.isInClean() << " isUnclean=" << nsc.isInUnclean()
457  << " sc seed detid: " << nsc.seed()->seed().rawId();
458  if (nsc.isInUnclean()) ++new_unclean;
459  if (nsc.isInClean()) ++new_clean;
460  }
461  if ( (new_unclean != uncleanSize) || (new_clean != cleanSize) ) {
462  LogTrace("UnifiedSC") << ">>>>!!!!!! MISMATCH: new unclean/ old unclean= "
463  << new_unclean << " / " << uncleanSize
464  << ", new clean/ old clean" << new_clean << " / " << cleanSize;
465  }
466 
467 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
edm::EDGetTokenT< reco::SuperClusterCollection > uncleanScCollection_
bool isInUnclean() const
Definition: CaloCluster.h:184
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:140
edm::Ptr< CaloCluster > CaloClusterPtr
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:166
void setFlags(uint32_t flags)
Definition: CaloCluster.h:179
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
double energy() const
cluster energy
Definition: CaloCluster.h:124
edm::EDGetTokenT< reco::BasicClusterCollection > uncleanBcCollection_
#define LogTrace(id)
bool isInClean() const
Definition: CaloCluster.h:183
edm::EDGetTokenT< reco::SuperClusterCollection > cleanScCollection_
edm::EDGetTokenT< reco::BasicClusterCollection > cleanBcCollection_
Definition: DetId.h:18
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

std::string UnifiedSCCollectionProducer::bcCollection_
private

Definition at line 36 of file UnifiedSCCollectionProducer.h.

Referenced by produce(), and UnifiedSCCollectionProducer().

std::string UnifiedSCCollectionProducer::bcCollectionUncleanOnly_
private

Definition at line 38 of file UnifiedSCCollectionProducer.h.

Referenced by produce(), and UnifiedSCCollectionProducer().

edm::EDGetTokenT<reco::BasicClusterCollection> UnifiedSCCollectionProducer::cleanBcCollection_
private

Definition at line 29 of file UnifiedSCCollectionProducer.h.

Referenced by produce(), and UnifiedSCCollectionProducer().

edm::EDGetTokenT<reco::SuperClusterCollection> UnifiedSCCollectionProducer::cleanScCollection_
private

Definition at line 30 of file UnifiedSCCollectionProducer.h.

Referenced by produce(), and UnifiedSCCollectionProducer().

std::string UnifiedSCCollectionProducer::scCollection_
private

Definition at line 37 of file UnifiedSCCollectionProducer.h.

Referenced by produce(), and UnifiedSCCollectionProducer().

std::string UnifiedSCCollectionProducer::scCollectionUncleanOnly_
private

Definition at line 39 of file UnifiedSCCollectionProducer.h.

Referenced by produce(), and UnifiedSCCollectionProducer().

edm::EDGetTokenT<reco::BasicClusterCollection> UnifiedSCCollectionProducer::uncleanBcCollection_
private

Definition at line 32 of file UnifiedSCCollectionProducer.h.

Referenced by produce(), and UnifiedSCCollectionProducer().

edm::EDGetTokenT<reco::SuperClusterCollection> UnifiedSCCollectionProducer::uncleanScCollection_
private

Definition at line 33 of file UnifiedSCCollectionProducer.h.

Referenced by produce(), and UnifiedSCCollectionProducer().