CMS 3D CMS Logo

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

#include <GEMCoPadProcessor.h>

Public Types

enum  { MAX_CoPad_BINS = 3 }
 

Public Member Functions

void clear ()
 
void declusterize (const GEMPadDigiClusterCollection *, GEMPadDigiCollection &) const
 
 GEMCoPadProcessor (unsigned endcap, unsigned station, unsigned chamber, const edm::ParameterSet &copad)
 
 GEMCoPadProcessor ()
 
const std::vector< GEMCoPadDigi > & readoutCoPads () const
 
std::vector< GEMCoPadDigirun (const GEMPadDigiCollection *)
 
std::vector< GEMCoPadDigirun (const GEMPadDigiClusterCollection *)
 

Private Attributes

std::vector< GEMCoPadDigigemCoPadV
 
unsigned int infoV
 
unsigned int maxDeltaBX_
 
unsigned int maxDeltaPad_
 
unsigned int maxDeltaRoll_
 
const int theChamber
 
const int theEndcap
 
const int theStation
 

Detailed Description

Author
Sven Dildick (TAMU)

Definition at line 17 of file GEMCoPadProcessor.h.

Member Enumeration Documentation

anonymous enum

Maximum number of time bins.

Enumerator
MAX_CoPad_BINS 

Definition at line 40 of file GEMCoPadProcessor.h.

Constructor & Destructor Documentation

GEMCoPadProcessor::GEMCoPadProcessor ( unsigned  endcap,
unsigned  station,
unsigned  chamber,
const edm::ParameterSet copad 
)

Normal constructor.

Definition at line 11 of file GEMCoPadProcessor.cc.

References edm::ParameterSet::getParameter(), infoV, maxDeltaBX_, maxDeltaPad_, and maxDeltaRoll_.

14  :
16 {
17  // Verbosity level, set to 0 (no print) by default.
18  infoV = copad.getParameter<unsigned int>("verbosity");
19  maxDeltaPad_ = copad.getParameter<unsigned int>("maxDeltaPad");
20  maxDeltaRoll_ = copad.getParameter<unsigned int>("maxDeltaRoll");
21  maxDeltaBX_ = copad.getParameter<unsigned int>("maxDeltaBX");
22 }
T getParameter(std::string const &) const
unsigned int maxDeltaBX_
unsigned int maxDeltaPad_
unsigned int maxDeltaRoll_
GEMCoPadProcessor::GEMCoPadProcessor ( )

Default constructor. Used for testing.

Definition at line 24 of file GEMCoPadProcessor.cc.

References infoV, maxDeltaBX_, maxDeltaPad_, and maxDeltaRoll_.

24  :
26 {
27  infoV = 0;
28  maxDeltaPad_ = 0;
29  maxDeltaRoll_ = 0;
30  maxDeltaBX_ = 0;
31 }
unsigned int maxDeltaBX_
unsigned int maxDeltaPad_
unsigned int maxDeltaRoll_

Member Function Documentation

void GEMCoPadProcessor::clear ( void  )

Clear copad vector

Definition at line 34 of file GEMCoPadProcessor.cc.

References gemCoPadV.

35 {
36  gemCoPadV.clear();
37 }
std::vector< GEMCoPadDigi > gemCoPadV
void GEMCoPadProcessor::declusterize ( const GEMPadDigiClusterCollection in_clusters,
GEMPadDigiCollection out_pads 
) const

Definition at line 102 of file GEMCoPadProcessor.cc.

References AlCaHLTBitMon_ParallelJobs::p.

Referenced by run().

104 {
105  for (auto detUnitIt = in_clusters->begin();detUnitIt != in_clusters->end(); ++detUnitIt) {
106  const GEMDetId& id = (*detUnitIt).first;
107  const auto& range = (*detUnitIt).second;
108  for (auto digiIt = range.first; digiIt!=range.second; ++digiIt) {
109  for (const auto& p: digiIt->pads()){
110  out_pads.insertDigi(id, GEMPadDigi(p, digiIt->bx()));
111  }
112  }
113  }
114 }
const std::vector< GEMCoPadDigi > & GEMCoPadProcessor::readoutCoPads ( ) const

Returns vector of CoPads in the read-out time window, if any.

Definition at line 96 of file GEMCoPadProcessor.cc.

References gemCoPadV.

97 {
98  return gemCoPadV;
99 }
std::vector< GEMCoPadDigi > gemCoPadV
std::vector< GEMCoPadDigi > GEMCoPadProcessor::run ( const GEMPadDigiCollection in_pads)

Runs the CoPad processor code. Called in normal running – gets info from a collection of pad digis.

Definition at line 40 of file GEMCoPadProcessor.cc.

References funct::abs(), relativeConstraints::chamber, gemCoPadV, maxDeltaBX_, maxDeltaPad_, maxDeltaRoll_, or, AlCaHLTBitMon_ParallelJobs::p, relativeConstraints::ring, relativeConstraints::station, theChamber, theEndcap, and theStation.

Referenced by run().

41 {
42  const int region((theEndcap == 1) ? 1: -1);
43 
44  // Build coincidences
45  for (auto det_range = in_pads->begin(); det_range != in_pads->end(); ++det_range) {
46  const GEMDetId& id = (*det_range).first;
47 
48  // same chamber (no restriction on the roll number)
49  if (id.region() != region or
50  id.station() != theStation or
51  id.chamber() != theChamber) continue;
52 
53  // all coincidences detIDs will have layer=1
54  if (id.layer() != 1) continue;
55 
56  // find all corresponding ids with layer 2 and same roll that differs at most maxDeltaRoll_
57  for (unsigned int roll = id.roll() - maxDeltaRoll_; roll <= id.roll() + maxDeltaRoll_; ++roll){
58 
59  GEMDetId co_id(id.region(), id.ring(), id.station(), 2, id.chamber(), roll);
60 
61  auto co_pads_range = in_pads->get(co_id);
62 
63  // empty range = no possible coincidence pads
64  if (co_pads_range.first == co_pads_range.second) continue;
65 
66  // now let's correlate the pads in two layers of this partition
67  const auto& pads_range = (*det_range).second;
68  for (auto p = pads_range.first; p != pads_range.second; ++p) {
69  for (auto co_p = co_pads_range.first; co_p != co_pads_range.second; ++co_p) {
70 
71  // check the match in pad
72  if ((unsigned)std::abs(p->pad() - co_p->pad()) > maxDeltaPad_) continue;
73 
74  // check the match in BX
75  if ((unsigned)std::abs(p->bx() - co_p->bx()) > maxDeltaBX_) continue;
76 
77  // make a new coincidence pad digi
78  gemCoPadV.push_back(GEMCoPadDigi(id.roll(),*p,*co_p));
79  }
80  }
81  }
82  }
83  return gemCoPadV;
84 }
std::vector< GEMCoPadDigi > gemCoPadV
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned int maxDeltaBX_
unsigned int maxDeltaPad_
unsigned int maxDeltaRoll_
std::vector< GEMCoPadDigi > GEMCoPadProcessor::run ( const GEMPadDigiClusterCollection in_clusters)

Runs the CoPad processor code. Called in normal running – gets info from a collection of pad digi clusters.

Definition at line 87 of file GEMCoPadProcessor.cc.

References declusterize(), and run().

88 {
89  std::unique_ptr<GEMPadDigiCollection> out_pads(new GEMPadDigiCollection());
90  declusterize(in_clusters, *out_pads);
91  return run(out_pads.get());
92 }
std::vector< GEMCoPadDigi > run(const GEMPadDigiCollection *)
void declusterize(const GEMPadDigiClusterCollection *, GEMPadDigiCollection &) const
MuonDigiCollection< GEMDetId, GEMPadDigi > GEMPadDigiCollection

Member Data Documentation

std::vector<GEMCoPadDigi> GEMCoPadProcessor::gemCoPadV
private

Definition at line 64 of file GEMCoPadProcessor.h.

Referenced by clear(), readoutCoPads(), and run().

unsigned int GEMCoPadProcessor::infoV
private

Verbosity level: 0: no print (default). 1: print only CoPads found. 2: info at every step of the algorithm. 3: add special-purpose prints.

Definition at line 58 of file GEMCoPadProcessor.h.

Referenced by GEMCoPadProcessor().

unsigned int GEMCoPadProcessor::maxDeltaBX_
private

Definition at line 60 of file GEMCoPadProcessor.h.

Referenced by GEMCoPadProcessor(), and run().

unsigned int GEMCoPadProcessor::maxDeltaPad_
private

Definition at line 59 of file GEMCoPadProcessor.h.

Referenced by GEMCoPadProcessor(), and run().

unsigned int GEMCoPadProcessor::maxDeltaRoll_
private

Definition at line 61 of file GEMCoPadProcessor.h.

Referenced by GEMCoPadProcessor(), and run().

const int GEMCoPadProcessor::theChamber
private

Definition at line 52 of file GEMCoPadProcessor.h.

Referenced by run().

const int GEMCoPadProcessor::theEndcap
private

Chamber id (trigger-type labels).

Definition at line 50 of file GEMCoPadProcessor.h.

Referenced by run().

const int GEMCoPadProcessor::theStation
private

Definition at line 51 of file GEMCoPadProcessor.h.

Referenced by run().