47 if (in_clusters ==
nullptr) {
48 edm::LogWarning(
"GEMClusterProcessor") <<
"Attempt to run without valid in_clusters pointer.";
63 std::vector<GEMInternalCluster>
output;
67 if (
cl.bx() ==
bx and
cl.isValid()) {
82 for (
auto det_range = in_clusters->begin(); det_range != in_clusters->end(); ++det_range) {
83 const GEMDetId&
id = (*det_range).first;
101 auto co_clusters_range = in_clusters->get(co_id);
104 if (co_clusters_range.first == co_clusters_range.second)
108 const auto& pads_range = (*det_range).second;
109 for (
auto p = pads_range.first;
p != pads_range.second; ++
p) {
120 for (
auto co_p = co_clusters_range.first; co_p != co_clusters_range.second; ++co_p) {
122 if (!co_p->isValid())
134 int cl2_min = co_p->pads().front();
135 int cl2_max = co_p->pads().back();
138 const bool condition1(cl1_min <= cl2_min and cl1_max >= cl2_min);
139 const bool condition2(cl1_min <= cl2_max and cl1_max >= cl2_max);
140 const bool match(condition1
or condition2);
145 auto const& p_pads =
p->pads();
146 auto const& co_p_pads = co_p->pads();
148 int num_unphys_pads_in_p = std::count_if(p_pads.begin(), p_pads.end(), [](
auto pad) {
return pad >= 192; });
149 int num_unphys_pads_co_p =
150 std::count_if(co_p_pads.begin(), co_p_pads.end(), [](
auto pad) {
return pad >= 192; });
152 if (num_unphys_pads_in_p > 0 || num_unphys_pads_co_p > 0) {
154 <<
"Encountered unphysical GEM pads when making a coincidence cluster, resetting cluster to empty.";
171 const std::vector<GEMInternalCluster>& coincidences =
clusters_;
174 for (
auto det_range = in_clusters->begin(); det_range != in_clusters->end(); ++det_range) {
175 const GEMDetId&
id = (*det_range).first;
185 const auto& clusters_range = (*det_range).second;
186 for (
auto p = clusters_range.first;
p != clusters_range.second; ++
p) {
198 if (std::find_if(std::begin(coincidences), std::end(coincidences), [
p](
const GEMInternalCluster&
q) {
199 return q.has_cluster(*
p);
200 }) != std::end(coincidences))
203 auto const& p_pads =
p->pads();
204 int num_unphys_pads = std::count_if(p_pads.begin(), p_pads.end(), [](
auto pad) {
return pad >= 192; });
206 if (num_unphys_pads > 0) {
208 <<
"Encountered unphysical GEM pads when making a single cluster, resetting cluster to empty.";
214 if (
id.
layer() == 1) {
229 if (cluster.cl1().isValid()) {
231 const int layer1_first_pad = cluster.layer1_pad();
232 const int layer1_last_pad = layer1_first_pad + cluster.layer1_size() - 1;
235 int layer1_pad_to_first_es = -1;
236 int layer1_pad_to_last_es = -1;
238 int layer1_pad_to_first_es_me1a = -1;
239 int layer1_pad_to_last_es_me1a = -1;
270 int layer1_middle_es = (layer1_pad_to_first_es + layer1_pad_to_last_es) / 2.;
271 int layer1_middle_es_me1a = (layer1_pad_to_first_es_me1a + layer1_pad_to_last_es_me1a) / 2.;
273 cluster.set_layer1_first_es(layer1_pad_to_first_es);
274 cluster.set_layer1_last_es(layer1_pad_to_last_es);
275 cluster.set_layer1_middle_es(layer1_middle_es);
278 cluster.set_layer1_first_es_me1a(layer1_pad_to_first_es_me1a);
279 cluster.set_layer1_last_es_me1a(layer1_pad_to_last_es_me1a);
280 cluster.set_layer1_middle_es_me1a(layer1_middle_es_me1a);
285 const int roll = cluster.roll1() - 1;
287 int roll_l1_to_min_wg = -1;
288 int roll_l1_to_max_wg = -1;
313 cluster.set_layer1_min_wg(roll_l1_to_min_wg);
314 cluster.set_layer1_max_wg(roll_l1_to_max_wg);
317 if (cluster.cl2().isValid()) {
319 const int layer2_first_pad = cluster.layer2_pad();
320 const int layer2_last_pad = layer2_first_pad + cluster.layer2_size() - 1;
323 int layer2_pad_to_first_es = -1;
324 int layer2_pad_to_last_es = -1;
326 int layer2_pad_to_first_es_me1a = -1;
327 int layer2_pad_to_last_es_me1a = -1;
358 int layer2_middle_es =
int((layer2_pad_to_first_es + layer2_pad_to_last_es) / 2.0);
359 int layer2_middle_es_me1a =
int((layer2_pad_to_first_es_me1a + layer2_pad_to_last_es_me1a) / 2.0);
361 cluster.set_layer2_first_es(layer2_pad_to_first_es);
362 cluster.set_layer2_last_es(layer2_pad_to_last_es);
363 cluster.set_layer2_middle_es(layer2_middle_es);
366 cluster.set_layer2_first_es_me1a(layer2_pad_to_first_es_me1a);
367 cluster.set_layer2_last_es_me1a(layer2_pad_to_last_es_me1a);
368 cluster.set_layer2_middle_es_me1a(layer2_middle_es_me1a);
374 const int roll = cluster.roll2() - 1;
376 int roll_l2_to_min_wg = -1;
377 int roll_l2_to_max_wg = -1;
402 cluster.set_layer2_min_wg(roll_l2_to_min_wg);
403 cluster.set_layer2_max_wg(roll_l2_to_max_wg);
408 std::vector<GEMCoPadDigi>
output;
413 if (!cluster.isCoincidence())
417 output.emplace_back(cluster.roll2(), cluster.mid1(), cluster.mid2());
T getParameter(std::string const &) const
std::vector< GEMInternalCluster > clusters_
unsigned GEM_roll_L1_CSC_min_wg_ME21_even(unsigned roll) const
bool isME0(GeomDetEnumerators::SubDetector m)
unsigned GEM_roll_CSC_min_wg_ME11_odd(unsigned roll) const
unsigned GEM_pad_CSC_es_ME11b_odd(unsigned pad) const
std::vector< GEMInternalCluster > getClusters(int bx, ClusterTypes option=AllClusters) const
unsigned GEM_pad_CSC_es_ME21_even(unsigned pad) const
unsigned GEM_pad_CSC_es_ME11a_even(unsigned pad) const
unsigned GEM_roll_L1_CSC_max_wg_ME21_odd(unsigned roll) const
unsigned GEM_pad_CSC_es_ME11b_even(unsigned pad) const
unsigned int tmbL1aWindowSize_
unsigned GEM_pad_CSC_es_ME21_odd(unsigned pad) const
unsigned GEM_roll_CSC_min_wg_ME11_even(unsigned roll) const
unsigned GEM_roll_CSC_max_wg_ME11_even(unsigned roll) const
unsigned GEM_roll_L2_CSC_max_wg_ME21_odd(unsigned roll) const
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
Abs< T >::type abs(const T &t)
void run(const GEMPadDigiClusterCollection *, const CSCL1TPLookupTableME11ILT *lookupTableME11ILT, const CSCL1TPLookupTableME21ILT *lookupTableME21ILT)
void addSingleClusters(const GEMPadDigiClusterCollection *)
std::vector< GEMCoPadDigi > readoutCoPads() const
unsigned GEM_roll_L1_CSC_max_wg_ME21_even(unsigned roll) const
bool hasGE21Geometry16Partitions_
unsigned GEM_roll_L2_CSC_max_wg_ME21_even(unsigned roll) const
unsigned GEM_roll_L2_CSC_min_wg_ME21_even(unsigned roll) const
unsigned GEM_pad_CSC_es_ME11a_odd(unsigned pad) const
unsigned int maxDeltaRoll_
unsigned GEM_roll_CSC_max_wg_ME11_odd(unsigned roll) const
void addCoincidenceClusters(const GEMPadDigiClusterCollection *)
unsigned GEM_roll_L1_CSC_min_wg_ME21_odd(unsigned roll) const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
unsigned GEM_roll_L2_CSC_min_wg_ME21_odd(unsigned roll) const
GEMClusterProcessor(int region, unsigned station, unsigned chamber, const edm::ParameterSet &conf)
Log< level::Warning, false > LogWarning
unsigned int delayGEMinOTMB_
void doCoordinateConversion(const CSCL1TPLookupTableME11ILT *lookupTableME11ILT, const CSCL1TPLookupTableME21ILT *lookupTableME21ILT)
unsigned int maxDeltaPad_