CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
SiStripApprox2ApproxClusters Class Reference
Inheritance diagram for SiStripApprox2ApproxClusters:
edm::stream::EDProducer<>

Public Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 
 SiStripApprox2ApproxClusters (const edm::ParameterSet &conf)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

uint8_t approxVersion
 
std::string approxVersionS
 
edm::EDGetTokenT< edmNew::DetSetVector< SiStripApproximateCluster > > clusterToken
 
edm::InputTag inputApproxClusters
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 18 of file SiStripApprox2ApproxClusters.cc.

Constructor & Destructor Documentation

◆ SiStripApprox2ApproxClusters()

SiStripApprox2ApproxClusters::SiStripApprox2ApproxClusters ( const edm::ParameterSet conf)
explicit

Definition at line 32 of file SiStripApprox2ApproxClusters.cc.

References approxVersion, approxVersionS, clusterToken, edm::ParameterSet::getParameter(), inputApproxClusters, and AlCaHLTBitMon_QueryRunRegistry::string.

32  {
33  inputApproxClusters = conf.getParameter<edm::InputTag>("inputApproxClusters");
34  approxVersionS = conf.getParameter<std::string>("approxVersion");
35 
36  approxVersion = -1;
37 
38  if (approxVersionS == "ORIGINAL")
39  approxVersion = 0;
40  else if (approxVersionS == "FULL_WIDTH")
41  approxVersion = 1;
42  else if (approxVersionS == "BARY_RES_0.1")
43  approxVersion = 2;
44  else if (approxVersionS == "BARY_CHARGE_RES_0.1")
45  approxVersion = 3;
46 
47  clusterToken = consumes<edmNew::DetSetVector<SiStripApproximateCluster>>(inputApproxClusters);
48  produces<edmNew::DetSetVector<SiStripApproximateCluster>>();
49 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< edmNew::DetSetVector< SiStripApproximateCluster > > clusterToken

Member Function Documentation

◆ fillDescriptions()

void SiStripApprox2ApproxClusters::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 97 of file SiStripApprox2ApproxClusters.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

97  {
99  desc.add<edm::InputTag>("inputApproxClusters", edm::InputTag("siStripClusters"));
100  desc.add<std::string>("approxVersion", std::string("ORIGINAL"));
101 
102  descriptions.add("SiStripApprox2ApproxClusters", desc);
103 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void SiStripApprox2ApproxClusters::produce ( edm::Event event,
const edm::EventSetup  
)
override

Definition at line 51 of file SiStripApprox2ApproxClusters.cc.

References approxVersion, ALCARECOSiPixelCalSingleMuonDQM_cff::clusterCollection, clusterToken, alignCSCRings::ff, ALCARECOTkAlBeamHalo_cff::filter, CastorSimpleRecAlgoImpl::isSaturated(), eostools::move(), mps_fire::result, and ApeEstimator_cff::width.

51  {
52  auto result = std::make_unique<edmNew::DetSetVector<SiStripApproximateCluster>>();
53  const auto& clusterCollection = event.get(clusterToken);
54 
55  for (const auto& detClusters : clusterCollection) {
57 
58  for (const auto& cluster : detClusters) {
59  float barycenter = cluster.barycenter();
60  uint8_t width = cluster.width();
61  float avgCharge = cluster.avgCharge();
62  bool filter = cluster.filter();
63  bool isSaturated = cluster.isSaturated();
64 
65  switch (approxVersion) {
66  case 0: //ORIGINAL
67  barycenter = std::round(barycenter);
68  if (width > 0x3F)
69  width = 0x3F;
70  avgCharge = std::round(avgCharge);
71  break;
72  case 1: //FULL_WIDTH
73  barycenter = std::round(barycenter);
74  avgCharge = std::round(avgCharge);
75  break;
76  case 2: //BARY_RES_0.1
77  barycenter = std::round(barycenter * 10) / 10;
78  if (width > 0x3F)
79  width = 0x3F;
80  avgCharge = std::round(avgCharge);
81  break;
82  case 3: //BARY_CHARGE_RES_0.1
83  barycenter = std::round(barycenter * 10) / 10;
84  if (width > 0x3F)
85  width = 0x3F;
86  avgCharge = std::round(avgCharge * 10) / 10;
87  break;
88  }
89 
90  ff.push_back(SiStripApproximateCluster(barycenter, width, avgCharge, filter, isSaturated));
91  }
92  }
93 
94  event.put(std::move(result));
95 }
edm::EDGetTokenT< edmNew::DetSetVector< SiStripApproximateCluster > > clusterToken
bool isSaturated(const Digi &digi, const int &maxADCvalue, int ifirst, int n)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ approxVersion

uint8_t SiStripApprox2ApproxClusters::approxVersion
private

Definition at line 27 of file SiStripApprox2ApproxClusters.cc.

Referenced by produce(), and SiStripApprox2ApproxClusters().

◆ approxVersionS

std::string SiStripApprox2ApproxClusters::approxVersionS
private

Definition at line 28 of file SiStripApprox2ApproxClusters.cc.

Referenced by SiStripApprox2ApproxClusters().

◆ clusterToken

edm::EDGetTokenT<edmNew::DetSetVector<SiStripApproximateCluster> > SiStripApprox2ApproxClusters::clusterToken
private

Definition at line 29 of file SiStripApprox2ApproxClusters.cc.

Referenced by produce(), and SiStripApprox2ApproxClusters().

◆ inputApproxClusters

edm::InputTag SiStripApprox2ApproxClusters::inputApproxClusters
private

Definition at line 26 of file SiStripApprox2ApproxClusters.cc.

Referenced by SiStripApprox2ApproxClusters().