CMS 3D CMS Logo

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

Public Member Functions

void beginRun (edm::Run const &iRun, const edm::EventSetup &iEventSetup) override
 Create Trigger Units before starting event processing. More...
 
 DTTrigPhase2Prod (const edm::ParameterSet &pset)
 Constructor. More...
 
void endRun (edm::Run const &iRun, const edm::EventSetup &iEventSetup) override
 endRun: finish things More...
 
MP_QUALITY getMinimumQuality (void)
 
bool hasPosRF (int wh, int sec) const
 
bool inner (const metaPrimitive &mp) const
 
bool outer (const metaPrimitive &mp) const
 
void printmP (const std::string &ss, const metaPrimitive &mP) const
 
void printmP (const metaPrimitive &mP) const
 
void printmPC (const std::string &ss, const metaPrimitive &mP) const
 
void printmPC (const metaPrimitive &mP) const
 
void produce (edm::Event &iEvent, const edm::EventSetup &iEventSetup) override
 Producer: process every event and generates trigger data. More...
 
int rango (const metaPrimitive &mp) const
 
void setChiSquareThreshold (float ch2Thr)
 
void setMinimumQuality (MP_QUALITY q)
 
 ~DTTrigPhase2Prod () override
 Destructor. More...
 
- 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)
 

Public Attributes

const DTGeometrydtGeo_
 
edm::ESGetToken< DTGeometry, MuonGeometryRecorddtGeomH
 
std::vector< std::pair< int, MuonPath > > primitives_
 

Private Types

typedef std::map< DTChamberId, DTDigiCollection, std::less< DTChamberId > > DTDigiMap
 
typedef DTDigiMap::const_iterator DTDigiMap_const_iterator
 
typedef DTDigiMap::iterator DTDigiMap_iterator
 

Private Member Functions

void assignIndex (std::vector< metaPrimitive > &inMPaths)
 
void assignIndexPerBX (std::vector< metaPrimitive > &inMPaths)
 
int assignQualityOrder (const metaPrimitive &mP) const
 
std::vector< DTDigiCollection * > distribDigis (std::queue< std::pair< DTLayerId, DTDigi >> &inQ)
 
void processDigi (std::queue< std::pair< DTLayerId, DTDigi >> &inQ, std::vector< std::queue< std::pair< DTLayerId, DTDigi >> *> &vec)
 

Private Attributes

bool activateBuffer_
 
int algo_
 
bool allow_confirmation_
 
int co_option_
 
int co_quality_
 
bool debug_
 
int df_extended_
 
double dT0_correlate_TP_
 
edm::EDGetTokenT< DTDigiCollectiondtDigisToken_
 
bool dump_
 
std::shared_ptr< GlobalCoordsObtainerglobalcoordsobtainer_
 
std::unique_ptr< MotherGroupinggrouping_obj_
 
std::unique_ptr< LateralityProviderlatprovider_
 
int max_index_
 
std::unique_ptr< MuonPathAnalyzermpathanalyzer_
 
std::unique_ptr< MuonPathAnalyzermpathassociator_
 
std::unique_ptr< MPFiltermpathcoifilter_
 
std::unique_ptr< MuonPathConfirmatormpathconfirmator_
 
std::unique_ptr< MPFiltermpathcorfilter_
 
std::unique_ptr< MPFiltermpathhitsfilter_
 
std::unique_ptr< MPFiltermpathqualityenhancer_
 
std::unique_ptr< MPFiltermpathqualityenhancerbayes_
 
std::unique_ptr< MPFiltermpathredundantfilter_
 
int my_BXoffset_
 
bool my_CCBValid_
 
bool output_confirmed_
 
bool output_latpredictor_
 
bool output_matcher_
 
bool output_mixer_
 
bool output_slfilter_
 
bool output_slfitter_
 
const std::unordered_map< int, int > qmap_
 
std::unique_ptr< RPCIntegratorrpc_integrator_
 
edm::EDGetTokenT< RPCRecHitCollectionrpcRecHitsLabel_
 
int scenario_
 
bool skip_processing_
 
int superCellhalfspacewidth_
 
float superCelltimewidth_
 
bool useRPC_
 

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 81 of file DTTrigPhase2Prod.cc.

Member Typedef Documentation

◆ DTDigiMap

typedef std::map<DTChamberId, DTDigiCollection, std::less<DTChamberId> > DTTrigPhase2Prod::DTDigiMap
private

Definition at line 82 of file DTTrigPhase2Prod.cc.

◆ DTDigiMap_const_iterator

typedef DTDigiMap::const_iterator DTTrigPhase2Prod::DTDigiMap_const_iterator
private

Definition at line 84 of file DTTrigPhase2Prod.cc.

◆ DTDigiMap_iterator

typedef DTDigiMap::iterator DTTrigPhase2Prod::DTDigiMap_iterator
private

Definition at line 83 of file DTTrigPhase2Prod.cc.

Constructor & Destructor Documentation

◆ DTTrigPhase2Prod()

DTTrigPhase2Prod::DTTrigPhase2Prod ( const edm::ParameterSet pset)

Constructor.

Definition at line 198 of file DTTrigPhase2Prod.cc.

199  : qmap_({{8, 8}, {7, 7}, {6, 6}, {4, 4}, {3, 3}, {2, 2}, {1, 1}}) {
200  produces<L1Phase2MuDTPhContainer>();
201  produces<L1Phase2MuDTThContainer>();
202  produces<L1Phase2MuDTExtPhContainer>();
203  produces<L1Phase2MuDTExtThContainer>();
204 
205  debug_ = pset.getUntrackedParameter<bool>("debug");
206  dump_ = pset.getUntrackedParameter<bool>("dump");
207 
208  scenario_ = pset.getParameter<int>("scenario");
209 
210  df_extended_ = pset.getParameter<int>("df_extended");
211  co_option_ = pset.getParameter<int>("co_option");
212  co_quality_ = pset.getParameter<int>("co_quality");
213  max_index_ = pset.getParameter<int>("max_primitives") - 1;
214 
215  dtDigisToken_ = consumes<DTDigiCollection>(pset.getParameter<edm::InputTag>("digiTag"));
216 
217  rpcRecHitsLabel_ = consumes<RPCRecHitCollection>(pset.getParameter<edm::InputTag>("rpcRecHits"));
218  useRPC_ = pset.getParameter<bool>("useRPC");
219 
220  // Choosing grouping scheme:
221  algo_ = pset.getParameter<int>("algo");
222 
223  // shortcuts
224 
225  output_mixer_ = pset.getParameter<bool>("output_mixer");
226  output_latpredictor_ = pset.getParameter<bool>("output_latpredictor");
227  output_slfitter_ = pset.getParameter<bool>("output_slfitter");
228  output_slfilter_ = pset.getParameter<bool>("output_slfilter");
229  output_confirmed_ = pset.getParameter<bool>("output_confirmed");
230  output_matcher_ = pset.getParameter<bool>("output_matcher");
231  allow_confirmation_ = pset.getParameter<bool>("allow_confirmation");
232 
233  edm::ConsumesCollector consumesColl(consumesCollector());
234  globalcoordsobtainer_ = std::make_shared<GlobalCoordsObtainer>(pset);
235  globalcoordsobtainer_->generate_luts();
236 
237  if (algo_ == PseudoBayes) {
238  grouping_obj_ =
239  std::make_unique<PseudoBayesGrouping>(pset.getParameter<edm::ParameterSet>("PseudoBayesPattern"), consumesColl);
240  } else if (algo_ == HoughTrans) {
241  grouping_obj_ =
242  std::make_unique<HoughGrouping>(pset.getParameter<edm::ParameterSet>("HoughGrouping"), consumesColl);
243  } else {
244  grouping_obj_ = std::make_unique<TrapezoidalGrouping>(pset, consumesColl);
245  }
246 
247  if (algo_ == Standard) {
248  if (debug_)
249  LogDebug("DTTrigPhase2Prod") << "DTp2:constructor: JM analyzer";
250  mpathanalyzer_ = std::make_unique<MuonPathSLFitter>(pset, consumesColl, globalcoordsobtainer_);
251  latprovider_ = std::make_unique<LateralityCoarsedProvider>(pset, consumesColl);
252  } else {
253  if (debug_)
254  LogDebug("DTTrigPhase2Prod") << "DTp2:constructor: Full chamber analyzer";
255  mpathanalyzer_ = std::make_unique<MuonPathAnalyzerInChamber>(pset, consumesColl, globalcoordsobtainer_);
256  }
257 
258  // Getting buffer option
259  activateBuffer_ = pset.getParameter<bool>("activateBuffer");
260  superCellhalfspacewidth_ = pset.getParameter<int>("superCellspacewidth") / 2;
261  superCelltimewidth_ = pset.getParameter<double>("superCelltimewidth");
262 
263  mpathqualityenhancer_ = std::make_unique<MPSLFilter>(pset);
264  mpathqualityenhancerbayes_ = std::make_unique<MPQualityEnhancerFilterBayes>(pset);
265  mpathredundantfilter_ = std::make_unique<MPRedundantFilter>(pset);
266  mpathhitsfilter_ = std::make_unique<MPCleanHitsFilter>(pset);
267  mpathconfirmator_ = std::make_unique<MuonPathConfirmator>(pset, consumesColl);
268  mpathassociator_ = std::make_unique<MuonPathCorFitter>(pset, consumesColl, globalcoordsobtainer_);
269  mpathcorfilter_ = std::make_unique<MPCorFilter>(pset);
270  mpathcoifilter_ = std::make_unique<MPCoincidenceFilter>(pset);
271  rpc_integrator_ = std::make_unique<RPCIntegrator>(pset, consumesColl);
272 
273  dtGeomH = esConsumes<DTGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
274 }
std::unique_ptr< MotherGrouping > grouping_obj_
std::unique_ptr< LateralityProvider > latprovider_
std::unique_ptr< MPFilter > mpathhitsfilter_
edm::EDGetTokenT< DTDigiCollection > dtDigisToken_
std::unique_ptr< RPCIntegrator > rpc_integrator_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomH
std::unique_ptr< MuonPathConfirmator > mpathconfirmator_
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitsLabel_
std::unique_ptr< MuonPathAnalyzer > mpathanalyzer_
std::unique_ptr< MPFilter > mpathqualityenhancer_
std::unique_ptr< MPFilter > mpathcoifilter_
std::unique_ptr< MPFilter > mpathcorfilter_
std::unique_ptr< MPFilter > mpathredundantfilter_
std::shared_ptr< GlobalCoordsObtainer > globalcoordsobtainer_
std::unique_ptr< MuonPathAnalyzer > mpathassociator_
std::unique_ptr< MPFilter > mpathqualityenhancerbayes_
const std::unordered_map< int, int > qmap_
#define LogDebug(id)

◆ ~DTTrigPhase2Prod()

DTTrigPhase2Prod::~DTTrigPhase2Prod ( )
override

Destructor.

Definition at line 276 of file DTTrigPhase2Prod.cc.

References debug_, and LogDebug.

276  {
277  if (debug_)
278  LogDebug("DTTrigPhase2Prod") << "DTp2: calling destructor" << std::endl;
279 }
#define LogDebug(id)

Member Function Documentation

◆ assignIndex()

void DTTrigPhase2Prod::assignIndex ( std::vector< metaPrimitive > &  inMPaths)
private

Definition at line 1168 of file DTTrigPhase2Prod.cc.

References assignIndexPerBX(), L1TStage2uGTEmulatorClient_cff::BX, max_index_, funct::primitive(), and cmsdt::metaPrimitive::t0.

Referenced by produce().

1168  {
1169  std::map<int, std::vector<metaPrimitive>> primsPerBX;
1170  for (const auto& metaPrimitive : inMPaths) {
1171  int BX = round(metaPrimitive.t0 / 25.);
1172  primsPerBX[BX].push_back(metaPrimitive);
1173  }
1174  inMPaths.clear();
1175  for (auto& prims : primsPerBX) {
1176  assignIndexPerBX(prims.second);
1177  for (const auto& primitive : prims.second)
1178  if (primitive.index <= max_index_)
1179  inMPaths.push_back(primitive);
1180  }
1181 }
Primitive< F, X >::type primitive(const F &f)
Definition: Primitive.h:41
void assignIndexPerBX(std::vector< metaPrimitive > &inMPaths)

◆ assignIndexPerBX()

void DTTrigPhase2Prod::assignIndexPerBX ( std::vector< metaPrimitive > &  inMPaths)
private

Definition at line 1183 of file DTTrigPhase2Prod.cc.

References funct::abs(), assignQualityOrder(), EcalCondDB::inf, and nano_mu_digi_cff::rawId.

Referenced by assignIndex().

1183  {
1184  // First we asociate a new index to the metaprimitive depending on quality or phiB;
1185  uint32_t rawId = -1;
1186  int numP = -1;
1187  for (auto& metaPrimitiveIt : inMPaths) {
1188  numP++;
1189  rawId = metaPrimitiveIt.rawId;
1190  int iOrder = assignQualityOrder(metaPrimitiveIt);
1191  int inf = 0;
1192  int numP2 = -1;
1193  for (auto& metaPrimitiveItN : inMPaths) {
1194  int nOrder = assignQualityOrder(metaPrimitiveItN);
1195  numP2++;
1196  if (rawId != metaPrimitiveItN.rawId)
1197  continue;
1198  if (numP2 == numP) {
1199  metaPrimitiveIt.index = inf;
1200  break;
1201  } else if (iOrder < nOrder) {
1202  inf++;
1203  } else if (iOrder > nOrder) {
1204  metaPrimitiveItN.index++;
1205  } else if (iOrder == nOrder) {
1206  if (std::abs(metaPrimitiveIt.phiB) >= std::abs(metaPrimitiveItN.phiB)) {
1207  inf++;
1208  } else if (std::abs(metaPrimitiveIt.phiB) < std::abs(metaPrimitiveItN.phiB)) {
1209  metaPrimitiveItN.index++;
1210  }
1211  }
1212  } // ending second for
1213  } // ending first for
1214 }
string inf
Definition: EcalCondDB.py:96
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int assignQualityOrder(const metaPrimitive &mP) const

◆ assignQualityOrder()

int DTTrigPhase2Prod::assignQualityOrder ( const metaPrimitive mP) const
private

Definition at line 1216 of file DTTrigPhase2Prod.cc.

References qmap_, and cmsdt::metaPrimitive::quality.

Referenced by assignIndexPerBX().

1216  {
1217  if (mP.quality > 8 || mP.quality < 1)
1218  return -1;
1219 
1220  return qmap_.find(mP.quality)->second;
1221 }
const std::unordered_map< int, int > qmap_

◆ beginRun()

void DTTrigPhase2Prod::beginRun ( edm::Run const &  iRun,
const edm::EventSetup iEventSetup 
)
override

Create Trigger Units before starting event processing.

Definition at line 281 of file DTTrigPhase2Prod.cc.

References debug_, dtGeo_, dtGeomH, relativeConstraints::geom, edm::EventSetup::getHandle(), grouping_obj_, edm::RunBase::id(), LogDebug, mpathanalyzer_, mpathassociator_, mpathcoifilter_, mpathcorfilter_, mpathhitsfilter_, mpathqualityenhancer_, mpathqualityenhancerbayes_, mpathredundantfilter_, and edm::RunID::run().

281  {
282  if (debug_)
283  LogDebug("DTTrigPhase2Prod") << "beginRun " << iRun.id().run();
284  if (debug_)
285  LogDebug("DTTrigPhase2Prod") << "beginRun: getting DT geometry";
286 
287  grouping_obj_->initialise(iEventSetup); // Grouping object initialisation
288  mpathanalyzer_->initialise(iEventSetup); // Analyzer object initialisation
289  mpathqualityenhancer_->initialise(iEventSetup); // Filter object initialisation
290  mpathredundantfilter_->initialise(iEventSetup); // Filter object initialisation
291  mpathqualityenhancerbayes_->initialise(iEventSetup); // Filter object initialisation
292  mpathhitsfilter_->initialise(iEventSetup);
293  mpathassociator_->initialise(iEventSetup); // Associator object initialisation
294  mpathcorfilter_->initialise(iEventSetup);
295  mpathcoifilter_->initialise(iEventSetup);
296 
297  if (auto geom = iEventSetup.getHandle(dtGeomH)) {
298  dtGeo_ = &(*geom);
299  }
300 }
std::unique_ptr< MotherGrouping > grouping_obj_
std::unique_ptr< MPFilter > mpathhitsfilter_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomH
const DTGeometry * dtGeo_
std::unique_ptr< MuonPathAnalyzer > mpathanalyzer_
std::unique_ptr< MPFilter > mpathqualityenhancer_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
std::unique_ptr< MPFilter > mpathcoifilter_
std::unique_ptr< MPFilter > mpathcorfilter_
std::unique_ptr< MPFilter > mpathredundantfilter_
std::unique_ptr< MuonPathAnalyzer > mpathassociator_
std::unique_ptr< MPFilter > mpathqualityenhancerbayes_
#define LogDebug(id)

◆ distribDigis()

std::vector< DTDigiCollection * > DTTrigPhase2Prod::distribDigis ( std::queue< std::pair< DTLayerId, DTDigi >> &  inQ)
private

Definition at line 1223 of file DTTrigPhase2Prod.cc.

References processDigi().

Referenced by produce().

1223  {
1224  std::vector<std::queue<std::pair<DTLayerId, DTDigi>>*> tmpVector;
1225  tmpVector.clear();
1226  std::vector<DTDigiCollection*> collVector;
1227  collVector.clear();
1228  while (!inQ.empty()) {
1229  processDigi(inQ, tmpVector);
1230  }
1231  for (auto& sQ : tmpVector) {
1232  DTDigiCollection tmpColl;
1233  while (!sQ->empty()) {
1234  tmpColl.insertDigi((sQ->front().first), (sQ->front().second));
1235  sQ->pop();
1236  }
1237  collVector.push_back(&tmpColl);
1238  }
1239  return collVector;
1240 }
void processDigi(std::queue< std::pair< DTLayerId, DTDigi >> &inQ, std::vector< std::queue< std::pair< DTLayerId, DTDigi >> *> &vec)

◆ endRun()

void DTTrigPhase2Prod::endRun ( edm::Run const &  iRun,
const edm::EventSetup iEventSetup 
)
override

endRun: finish things

Definition at line 1083 of file DTTrigPhase2Prod.cc.

References grouping_obj_, mpathanalyzer_, mpathassociator_, mpathhitsfilter_, mpathqualityenhancer_, mpathqualityenhancerbayes_, mpathredundantfilter_, and rpc_integrator_.

1083  {
1084  grouping_obj_->finish();
1085  mpathanalyzer_->finish();
1086  mpathqualityenhancer_->finish();
1087  mpathqualityenhancerbayes_->finish();
1088  mpathredundantfilter_->finish();
1089  mpathhitsfilter_->finish();
1090  mpathassociator_->finish();
1091  rpc_integrator_->finish();
1092 };
std::unique_ptr< MotherGrouping > grouping_obj_
std::unique_ptr< MPFilter > mpathhitsfilter_
std::unique_ptr< RPCIntegrator > rpc_integrator_
std::unique_ptr< MuonPathAnalyzer > mpathanalyzer_
std::unique_ptr< MPFilter > mpathqualityenhancer_
std::unique_ptr< MPFilter > mpathredundantfilter_
std::unique_ptr< MuonPathAnalyzer > mpathassociator_
std::unique_ptr< MPFilter > mpathqualityenhancerbayes_

◆ fillDescriptions()

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

Definition at line 1272 of file DTTrigPhase2Prod.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

1272  {
1273  // dtTriggerPhase2PrimitiveDigis
1275  desc.add<edm::InputTag>("digiTag", edm::InputTag("CalibratedDigis"));
1276  desc.add<int>("timeTolerance", 999999);
1277  desc.add<double>("tanPhiTh", 1.0);
1278  desc.add<double>("tanPhiThw2max", 1.3);
1279  desc.add<double>("tanPhiThw2min", 0.5);
1280  desc.add<double>("tanPhiThw1max", 0.9);
1281  desc.add<double>("tanPhiThw1min", 0.2);
1282  desc.add<double>("tanPhiThw0", 0.5);
1283  desc.add<double>("chi2Th", 0.01);
1284  desc.add<double>("chi2corTh", 0.1);
1285  desc.add<bool>("useBX_correlation", false);
1286  desc.add<double>("dT0_correlate_TP", 25.0);
1287  desc.add<int>("dBX_correlate_TP", 0);
1288  desc.add<double>("dTanPsi_correlate_TP", 99999.0);
1289  desc.add<bool>("clean_chi2_correlation", true);
1290  desc.add<bool>("allow_confirmation", true);
1291  desc.add<double>("minx_match_2digis", 1.0);
1292  desc.add<int>("scenario", 0);
1293  desc.add<int>("df_extended", 0);
1294  desc.add<int>("co_option", 0);
1295  desc.add<int>("co_quality", 0);
1296  desc.add<int>("max_primitives", 999);
1297  desc.add<bool>("output_mixer", false);
1298  desc.add<bool>("output_latpredictor", false);
1299  desc.add<bool>("output_slfitter", false);
1300  desc.add<bool>("output_slfilter", false);
1301  desc.add<bool>("output_confirmed", false);
1302  desc.add<bool>("output_matcher", false);
1303  desc.add<edm::FileInPath>("ttrig_filename", edm::FileInPath("L1Trigger/DTTriggerPhase2/data/wire_rawId_ttrig.txt"));
1304  desc.add<edm::FileInPath>("z_filename", edm::FileInPath("L1Trigger/DTTriggerPhase2/data/wire_rawId_z.txt"));
1305  desc.add<edm::FileInPath>("lut_sl1", edm::FileInPath("L1Trigger/DTTriggerPhase2/data/fitterlut_sl1.dat"));
1306  desc.add<edm::FileInPath>("lut_sl2", edm::FileInPath("L1Trigger/DTTriggerPhase2/data/fitterlut_slx.dat"));
1307  desc.add<edm::FileInPath>("lut_sl3", edm::FileInPath("L1Trigger/DTTriggerPhase2/data/fitterlut_sl3.dat"));
1308  desc.add<edm::FileInPath>("lut_2sl", edm::FileInPath("L1Trigger/DTTriggerPhase2/data/fitterlut_2sl.dat"));
1309  desc.add<edm::FileInPath>("shift_filename", edm::FileInPath("L1Trigger/DTTriggerPhase2/data/wire_rawId_x.txt"));
1310  desc.add<edm::FileInPath>("maxdrift_filename",
1311  edm::FileInPath("L1Trigger/DTTriggerPhase2/data/drift_time_per_chamber.txt"));
1312  desc.add<edm::FileInPath>("shift_theta_filename", edm::FileInPath("L1Trigger/DTTriggerPhase2/data/theta_shift.txt"));
1313  desc.add<edm::FileInPath>("global_coords_filename",
1314  edm::FileInPath("L1Trigger/DTTriggerPhase2/data/global_coord_perp_x_phi0.txt"));
1315  desc.add<edm::FileInPath>("laterality_filename",
1316  edm::FileInPath("L1Trigger/DTTriggerPhase2/data/lat_predictions.dat"));
1317  desc.add<int>("algo", 0);
1318  desc.add<int>("minHits4Fit", 3);
1319  desc.add<bool>("splitPathPerSL", true);
1320  desc.addUntracked<bool>("debug", false);
1321  desc.addUntracked<bool>("dump", false);
1322  desc.add<edm::InputTag>("rpcRecHits", edm::InputTag("rpcRecHits"));
1323  desc.add<bool>("useRPC", false);
1324  desc.add<int>("bx_window", 1);
1325  desc.add<double>("phi_window", 50.0);
1326  desc.add<int>("max_quality_to_overwrite_t0", 9);
1327  desc.add<bool>("storeAllRPCHits", false);
1328  desc.add<bool>("activateBuffer", false);
1329  desc.add<double>("superCelltimewidth", 400);
1330  desc.add<int>("superCellspacewidth", 20);
1331  {
1333  psd0.addUntracked<bool>("debug", false);
1334  psd0.add<double>("angletan", 0.3);
1335  psd0.add<double>("anglebinwidth", 1.0);
1336  psd0.add<double>("posbinwidth", 2.1);
1337  psd0.add<double>("maxdeltaAngDeg", 10);
1338  psd0.add<double>("maxdeltaPos", 10);
1339  psd0.add<int>("UpperNumber", 6);
1340  psd0.add<int>("LowerNumber", 4);
1341  psd0.add<double>("MaxDistanceToWire", 0.03);
1342  psd0.add<int>("minNLayerHits", 6);
1343  psd0.add<int>("minSingleSLHitsMax", 3);
1344  psd0.add<int>("minSingleSLHitsMin", 3);
1345  psd0.add<bool>("allowUncorrelatedPatterns", true);
1346  psd0.add<int>("minUncorrelatedHits", 3);
1347  desc.add<edm::ParameterSetDescription>("HoughGrouping", psd0);
1348  }
1349  {
1351  psd0.add<edm::FileInPath>(
1352  "pattern_filename", edm::FileInPath("L1Trigger/DTTriggerPhase2/data/PseudoBayesPatterns_uncorrelated_v0.root"));
1353  psd0.addUntracked<bool>("debug", false);
1354  psd0.add<int>("minNLayerHits", 3);
1355  psd0.add<int>("minSingleSLHitsMax", 3);
1356  psd0.add<int>("minSingleSLHitsMin", 0);
1357  psd0.add<int>("allowedVariance", 1);
1358  psd0.add<bool>("allowDuplicates", false);
1359  psd0.add<bool>("setLateralities", true);
1360  psd0.add<bool>("allowUncorrelatedPatterns", true);
1361  psd0.add<int>("minUncorrelatedHits", 3);
1362  psd0.add<bool>("saveOnPlace", true);
1363  psd0.add<int>("maxPathsPerMatch", 256);
1364  desc.add<edm::ParameterSetDescription>("PseudoBayesPattern", psd0);
1365  }
1366  descriptions.add("dtTriggerPhase2PrimitiveDigis", desc);
1367 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ getMinimumQuality()

MP_QUALITY DTTrigPhase2Prod::getMinimumQuality ( void  )

◆ hasPosRF()

bool DTTrigPhase2Prod::hasPosRF ( int  wh,
int  sec 
) const

Definition at line 1104 of file DTTrigPhase2Prod.cc.

References fileinputsource_cfi::sec.

1104 { return wh > 0 || (wh == 0 && sec % 4 > 1); }

◆ inner()

bool DTTrigPhase2Prod::inner ( const metaPrimitive mp) const

Definition at line 1099 of file DTTrigPhase2Prod.cc.

References cmsdt::metaPrimitive::wi1, cmsdt::metaPrimitive::wi2, cmsdt::metaPrimitive::wi3, and cmsdt::metaPrimitive::wi4.

Referenced by produce().

1099  {
1100  int counter = (mp.wi1 != -1) + (mp.wi2 != -1) + (mp.wi3 != -1) + (mp.wi4 != -1);
1101  return (counter > 2);
1102 }

◆ outer()

bool DTTrigPhase2Prod::outer ( const metaPrimitive mp) const

Definition at line 1094 of file DTTrigPhase2Prod.cc.

References cmsdt::metaPrimitive::wi5, cmsdt::metaPrimitive::wi6, cmsdt::metaPrimitive::wi7, and cmsdt::metaPrimitive::wi8.

1094  {
1095  int counter = (mp.wi5 != -1) + (mp.wi6 != -1) + (mp.wi7 != -1) + (mp.wi8 != -1);
1096  return (counter > 2);
1097 }

◆ printmP() [1/2]

void DTTrigPhase2Prod::printmP ( const std::string &  ss,
const metaPrimitive mP 
) const

Referenced by produce().

◆ printmP() [2/2]

void DTTrigPhase2Prod::printmP ( const metaPrimitive mP) const

Definition at line 1116 of file DTTrigPhase2Prod.cc.

References cmsdt::metaPrimitive::chi2, createfilelist::int, rango(), cmsdt::metaPrimitive::rawId, cmsdt::metaPrimitive::t0, cmsdt::metaPrimitive::tanPhi, cmsdt::metaPrimitive::tdc1, cmsdt::metaPrimitive::tdc2, cmsdt::metaPrimitive::tdc3, cmsdt::metaPrimitive::tdc4, cmsdt::metaPrimitive::wi1, cmsdt::metaPrimitive::wi2, cmsdt::metaPrimitive::wi3, cmsdt::metaPrimitive::wi4, and cmsdt::metaPrimitive::x.

1116  {
1117  DTSuperLayerId slId(mP.rawId);
1118  LogInfo("DTTrigPhase2Prod") << (int)slId << "\t " << setw(2) << left << mP.wi1 << " " << setw(2) << left << mP.wi2
1119  << " " << setw(2) << left << mP.wi3 << " " << setw(2) << left << mP.wi4 << " " << setw(5)
1120  << left << mP.tdc1 << " " << setw(5) << left << mP.tdc2 << " " << setw(5) << left
1121  << mP.tdc3 << " " << setw(5) << left << mP.tdc4 << " " << setw(10) << right << mP.x << " "
1122  << setw(9) << left << mP.tanPhi << " " << setw(5) << left << mP.t0 << " " << setw(13)
1123  << left << mP.chi2 << " r:" << rango(mP) << std::endl;
1124 }
Log< level::Info, false > LogInfo
int rango(const metaPrimitive &mp) const

◆ printmPC() [1/2]

void DTTrigPhase2Prod::printmPC ( const std::string &  ss,
const metaPrimitive mP 
) const

Referenced by produce().

◆ printmPC() [2/2]

void DTTrigPhase2Prod::printmPC ( const metaPrimitive mP) const

Definition at line 1143 of file DTTrigPhase2Prod.cc.

References cmsdt::metaPrimitive::chi2, IntegrityClient_cfi::ChId, createfilelist::int, cmsdt::metaPrimitive::lat1, cmsdt::metaPrimitive::lat2, cmsdt::metaPrimitive::lat3, cmsdt::metaPrimitive::lat4, cmsdt::metaPrimitive::lat5, cmsdt::metaPrimitive::lat6, cmsdt::metaPrimitive::lat7, cmsdt::metaPrimitive::lat8, rango(), cmsdt::metaPrimitive::rawId, cmsdt::metaPrimitive::t0, cmsdt::metaPrimitive::tanPhi, cmsdt::metaPrimitive::tdc1, cmsdt::metaPrimitive::tdc2, cmsdt::metaPrimitive::tdc3, cmsdt::metaPrimitive::tdc4, cmsdt::metaPrimitive::tdc5, cmsdt::metaPrimitive::tdc6, cmsdt::metaPrimitive::tdc7, cmsdt::metaPrimitive::tdc8, cmsdt::metaPrimitive::wi1, cmsdt::metaPrimitive::wi2, cmsdt::metaPrimitive::wi3, cmsdt::metaPrimitive::wi4, cmsdt::metaPrimitive::wi5, cmsdt::metaPrimitive::wi6, cmsdt::metaPrimitive::wi7, cmsdt::metaPrimitive::wi8, and cmsdt::metaPrimitive::x.

1143  {
1144  DTChamberId ChId(mP.rawId);
1145  LogInfo("DTTrigPhase2Prod") << (int)ChId << "\t " << setw(2) << left << mP.wi1 << " " << setw(2) << left << mP.wi2
1146  << " " << setw(2) << left << mP.wi3 << " " << setw(2) << left << mP.wi4 << " " << setw(2)
1147  << left << mP.wi5 << " " << setw(2) << left << mP.wi6 << " " << setw(2) << left << mP.wi7
1148  << " " << setw(2) << left << mP.wi8 << " " << setw(5) << left << mP.tdc1 << " " << setw(5)
1149  << left << mP.tdc2 << " " << setw(5) << left << mP.tdc3 << " " << setw(5) << left
1150  << mP.tdc4 << " " << setw(5) << left << mP.tdc5 << " " << setw(5) << left << mP.tdc6
1151  << " " << setw(5) << left << mP.tdc7 << " " << setw(5) << left << mP.tdc8 << " "
1152  << setw(2) << left << mP.lat1 << " " << setw(2) << left << mP.lat2 << " " << setw(2)
1153  << left << mP.lat3 << " " << setw(2) << left << mP.lat4 << " " << setw(2) << left
1154  << mP.lat5 << " " << setw(2) << left << mP.lat6 << " " << setw(2) << left << mP.lat7
1155  << " " << setw(2) << left << mP.lat8 << " " << setw(10) << right << mP.x << " " << setw(9)
1156  << left << mP.tanPhi << " " << setw(5) << left << mP.t0 << " " << setw(13) << left
1157  << mP.chi2 << " r:" << rango(mP) << std::endl;
1158 }
Log< level::Info, false > LogInfo
int rango(const metaPrimitive &mp) const

◆ processDigi()

void DTTrigPhase2Prod::processDigi ( std::queue< std::pair< DTLayerId, DTDigi >> &  inQ,
std::vector< std::queue< std::pair< DTLayerId, DTDigi >> *> &  vec 
)
private

Definition at line 1242 of file DTTrigPhase2Prod.cc.

References eostools::move(), superCellhalfspacewidth_, and superCelltimewidth_.

Referenced by distribDigis().

1243  {
1244  bool classified = false;
1245  if (!vec.empty()) {
1246  for (auto& sC : vec) { // Conditions for entering a super cell.
1247  if ((sC->front().second.time() + superCelltimewidth_) > inQ.front().second.time()) {
1248  // Time requirement
1249  if (TMath::Abs(sC->front().second.wire() - inQ.front().second.wire()) <= superCellhalfspacewidth_) {
1250  // Spatial requirement
1251  sC->push(std::move(inQ.front()));
1252  classified = true;
1253  }
1254  }
1255  }
1256  }
1257  if (classified) {
1258  inQ.pop();
1259  return;
1260  }
1261 
1262  std::queue<std::pair<DTLayerId, DTDigi>> newQueue;
1263 
1264  std::pair<DTLayerId, DTDigi> tmpPair;
1265  tmpPair = std::move(inQ.front());
1266  newQueue.push(tmpPair);
1267  inQ.pop();
1268 
1269  vec.push_back(&newQueue);
1270 }
def move(src, dest)
Definition: eostools.py:511

◆ produce()

void DTTrigPhase2Prod::produce ( edm::Event iEvent,
const edm::EventSetup iEventSetup 
)
override

Producer: process every event and generates trigger data.

Fitting SECTION;

STORING RESULTs

Definition at line 302 of file DTTrigPhase2Prod.cc.

References activateBuffer_, algo_, allow_confirmation_, assignIndex(), DTSuperLayerId::chamberId(), DTGeometry::chambers(), cmsdt::CHI2RES_CONV, cmsdt::CHIGHQ, cscdqm::DATA, debug_, df_extended_, distribDigis(), dtDigisToken_, dtGeo_, dump_, ALCARECOEcalPhiSym_cff::float, grouping_obj_, mps_fire::i, DTChamber::id(), iEvent, inner(), createfilelist::int, cmsdt::KRES_CONV, latprovider_, cmsdt::LHC_CLK_FREQ, LogDebug, cmsdt::LOWLOWQ, WZElectronSkims53X_cff::max, cmsdt::MC, eostools::move(), mpathanalyzer_, mpathassociator_, mpathcoifilter_, mpathconfirmator_, mpathcorfilter_, mpathhitsfilter_, mpathqualityenhancer_, mpathredundantfilter_, output_confirmed_, output_latpredictor_, output_matcher_, output_mixer_, output_slfilter_, output_slfitter_, cmsdt::PHIBRES_CONV, cmsdt::PHIRES_CONV, printmP(), printmPC(), isotrackApplyRegressor::range, DetId::rawId(), rpc_integrator_, dtTriggerPhase2PrimitiveDigis_cfi::rpcRecHits, rpcRecHitsLabel_, scenario_, DTChamberId::sector(), skip_processing_, cmsdt::SLICE_TEST, jetUpdater_cfi::sort, contentValuesCheck::ss, cmsdt::Standard, DTChamberId::station(), DTSuperLayerId::superLayer(), DTLayerId::superlayerId(), cmsdt::TIME_TO_TDC_COUNTS, useRPC_, DTChamberId::wheel(), and cmsdt::ZRES_CONV.

302  {
303  if (debug_)
304  LogDebug("DTTrigPhase2Prod") << "produce";
306  iEvent.getByToken(dtDigisToken_, dtdigis);
307 
308  if (debug_)
309  LogDebug("DTTrigPhase2Prod") << "\t Getting the RPC RecHits" << std::endl;
311  iEvent.getByToken(rpcRecHitsLabel_, rpcRecHits);
312 
314  // GROUPING CODE:
316 
317  DTDigiMap digiMap;
319  for (const auto& detUnitIt : *dtdigis) {
320  const DTLayerId& layId = detUnitIt.first;
321  const DTChamberId chambId = layId.superlayerId().chamberId();
322  const DTDigiCollection::Range& range = detUnitIt.second;
323  digiMap[chambId].put(range, layId);
324  }
325 
326  // generate a list muon paths for each event!!!
327  if (debug_ && activateBuffer_)
328  LogDebug("DTTrigPhase2Prod") << "produce - Getting and grouping digis per chamber using a buffer and super cells.";
329  else if (debug_)
330  LogDebug("DTTrigPhase2Prod") << "produce - Getting and grouping digis per chamber.";
331 
332  std::map<int, MuonPathPtrs> muonpaths;
333  for (const auto& ich : dtGeo_->chambers()) {
334  // The code inside this for loop would ideally later fit inside a trigger unit (in principle, a DT station) of the future Phase 2 DT Trigger.
335  const DTChamber* chamb = ich;
336  DTChamberId chid = chamb->id();
337  DTDigiMap_iterator dmit = digiMap.find(chid);
338 
339  if (dmit == digiMap.end())
340  continue;
341 
342  if (activateBuffer_) { // Use buffering (per chamber) or not
343  // Import digis from the station
344  std::vector<std::pair<DTLayerId, DTDigi>> tmpvec;
345  tmpvec.clear();
346 
347  for (const auto& dtLayerIdIt : (*dmit).second) {
348  for (DTDigiCollection::const_iterator digiIt = (dtLayerIdIt.second).first;
349  digiIt != (dtLayerIdIt.second).second;
350  digiIt++) {
351  tmpvec.emplace_back(dtLayerIdIt.first, *digiIt);
352  }
353  }
354 
355  // Check to enhance CPU time usage
356  if (tmpvec.empty())
357  continue;
358 
359  // Order digis depending on TDC time and insert them into a queue (FIFO buffer). TODO: adapt for MC simulations.
360  std::sort(tmpvec.begin(), tmpvec.end(), DigiTimeOrdering);
361  std::queue<std::pair<DTLayerId, DTDigi>> timequeue;
362 
363  for (const auto& elem : tmpvec)
364  timequeue.emplace(elem);
365  tmpvec.clear();
366 
367  // Distribute the digis from the queue into supercells
368  std::vector<DTDigiCollection*> superCells;
369  superCells = distribDigis(timequeue);
370 
371  // Process each supercell & collect the resulting muonpaths (as the muonpaths std::vector is only enlarged each time
372  // the groupings access it, it's not needed to "collect" the final products).
373 
374  while (!superCells.empty()) {
375  grouping_obj_->run(iEvent, iEventSetup, *(superCells.back()), muonpaths[chid.rawId()]);
376  superCells.pop_back();
377  }
378  } else {
379  grouping_obj_->run(iEvent, iEventSetup, (*dmit).second, muonpaths[chid.rawId()]);
380  }
381  }
382  digiMap.clear();
383 
384  if (dump_) {
385  for (auto& ch_muonpaths : muonpaths) {
386  for (unsigned int i = 0; i < ch_muonpaths.second.size(); i++) {
387  stringstream ss;
388  ss << iEvent.id().event() << " mpath " << i << ": ";
389  for (int lay = 0; lay < ch_muonpaths.second.at(i)->nprimitives(); lay++)
390  ss << ch_muonpaths.second.at(i)->primitive(lay)->channelId() << " ";
391  for (int lay = 0; lay < ch_muonpaths.second.at(i)->nprimitives(); lay++)
392  ss << ch_muonpaths.second.at(i)->primitive(lay)->tdcTimeStamp() << " ";
393  for (int lay = 0; lay < ch_muonpaths.second.at(i)->nprimitives(); lay++)
394  ss << ch_muonpaths.second.at(i)->primitive(lay)->laterality() << " ";
395  LogInfo("DTTrigPhase2Prod") << ss.str();
396  }
397  }
398  }
399 
400  std::map<int, std::vector<lat_vector>> lateralities;
401  if (!output_mixer_) {
402  for (auto& ch_muonpaths : muonpaths) {
403  if (algo_ == Standard) {
404  latprovider_->run(iEvent, iEventSetup, ch_muonpaths.second, lateralities[ch_muonpaths.first]);
405  }
406  }
407  }
408 
409  // FILTER GROUPING
410  std::map<int, MuonPathPtrs> filteredmuonpaths;
411  for (auto& ch_muonpaths : muonpaths) {
412  if (algo_ == Standard) {
413  mpathredundantfilter_->run(iEvent, iEventSetup, ch_muonpaths.second, filteredmuonpaths[ch_muonpaths.first]);
414  } else {
415  mpathhitsfilter_->run(iEvent, iEventSetup, ch_muonpaths.second, filteredmuonpaths[ch_muonpaths.first]);
416  }
417  }
418 
419  if (dump_) {
420  for (auto& ch_filteredmuonpaths : filteredmuonpaths) {
421  for (unsigned int i = 0; i < ch_filteredmuonpaths.second.size(); i++) {
422  stringstream ss;
423  ss << iEvent.id().event() << " filt. mpath " << i << ": ";
424  for (int lay = 0; lay < ch_filteredmuonpaths.second.at(i)->nprimitives(); lay++)
425  ss << ch_filteredmuonpaths.second.at(i)->primitive(lay)->channelId() << " ";
426  for (int lay = 0; lay < ch_filteredmuonpaths.second.at(i)->nprimitives(); lay++)
427  ss << ch_filteredmuonpaths.second.at(i)->primitive(lay)->tdcTimeStamp() << " ";
428  LogInfo("DTTrigPhase2Prod") << ss.str();
429  }
430  }
431  }
432 
434 
438 
439  if (debug_) {
440  for (auto& ch_muonpaths : muonpaths) {
441  LogDebug("DTTrigPhase2Prod") << "MUON PATHS found: " << ch_muonpaths.second.size() << " ("
442  << filteredmuonpaths[ch_muonpaths.first].size() << ") in event "
443  << iEvent.id().event();
444  }
445  }
446  if (debug_)
447  LogDebug("DTTrigPhase2Prod") << "filling NmetaPrimtives" << std::endl;
448  std::map<int, std::vector<metaPrimitive>> metaPrimitives;
449  std::map<int, MuonPathPtrs> outmpaths;
450  if (algo_ == Standard) {
451  if (debug_)
452  LogDebug("DTTrigPhase2Prod") << "Fitting 1SL ";
453  for (auto& ch_muonpaths : muonpaths) { // FIXME, do we need filtered muonpaths?
455  mpathanalyzer_->run(iEvent,
456  iEventSetup,
457  ch_muonpaths.second,
458  lateralities[ch_muonpaths.first],
459  metaPrimitives[ch_muonpaths.first]);
460  else if (output_mixer_) {
461  for (auto& inMPath : ch_muonpaths.second) {
462  auto sl = inMPath->primitive(0)->superLayerId(); // 0, 1, 2
463  int selected_lay = 1;
464  if (inMPath->primitive(0)->tdcTimeStamp() != -1)
465  selected_lay = 0;
466  int dumLayId = inMPath->primitive(selected_lay)->cameraId();
467  auto dtDumlayerId = DTLayerId(dumLayId);
468  DTSuperLayerId MuonPathSLId(dtDumlayerId.wheel(), dtDumlayerId.station(), dtDumlayerId.sector(), sl + 1);
469  if (sl == 0)
470  metaPrimitives[ch_muonpaths.first].emplace_back(metaPrimitive({MuonPathSLId.rawId(),
471  -1,
472  -1,
473  -1,
474  -1,
475  -1,
476  -1,
477  -1,
478  -1,
479  -1,
480  inMPath->primitive(0)->channelId(),
481  inMPath->primitive(0)->tdcTimeStamp(),
482  -1,
483  inMPath->primitive(1)->channelId(),
484  inMPath->primitive(1)->tdcTimeStamp(),
485  -1,
486  inMPath->primitive(2)->channelId(),
487  inMPath->primitive(2)->tdcTimeStamp(),
488  -1,
489  inMPath->primitive(3)->channelId(),
490  inMPath->primitive(3)->tdcTimeStamp(),
491  -1,
492  -1,
493  -1,
494  -1,
495  -1,
496  -1,
497  -1,
498  -1,
499  -1,
500  -1,
501  -1,
502  -1,
503  -1,
504  -1}));
505  else
506  metaPrimitives[ch_muonpaths.first].emplace_back(metaPrimitive({MuonPathSLId.rawId(),
507  -1,
508  -1,
509  -1,
510  -1,
511  -1,
512  -1,
513  -1,
514  -1,
515  -1,
516  -1,
517  -1,
518  -1,
519  -1,
520  -1,
521  -1,
522  -1,
523  -1,
524  -1,
525  -1,
526  -1,
527  -1,
528  inMPath->primitive(0)->channelId(),
529  inMPath->primitive(0)->tdcTimeStamp(),
530  -1,
531  inMPath->primitive(1)->channelId(),
532  inMPath->primitive(1)->tdcTimeStamp(),
533  -1,
534  inMPath->primitive(2)->channelId(),
535  inMPath->primitive(2)->tdcTimeStamp(),
536  -1,
537  inMPath->primitive(3)->channelId(),
538  inMPath->primitive(3)->tdcTimeStamp(),
539  -1,
540  -1}));
541  }
542  } else if (output_latpredictor_) {
543  int imp = -1;
544  for (auto& inMPath : ch_muonpaths.second) {
545  imp++;
546  auto sl = inMPath->primitive(0)->superLayerId(); // 0, 1, 2
547  int selected_lay = 1;
548  if (inMPath->primitive(0)->tdcTimeStamp() != -1)
549  selected_lay = 0;
550  int dumLayId = inMPath->primitive(selected_lay)->cameraId();
551  auto dtDumlayerId = DTLayerId(dumLayId);
552  DTSuperLayerId MuonPathSLId(dtDumlayerId.wheel(), dtDumlayerId.station(), dtDumlayerId.sector(), sl + 1);
553  for (auto& latcomb : lateralities[ch_muonpaths.first][imp]) {
554  if (sl == 0)
555  metaPrimitives[ch_muonpaths.first].emplace_back(metaPrimitive({MuonPathSLId.rawId(),
556  -1,
557  -1,
558  -1,
559  -1,
560  -1,
561  -1,
562  -1,
563  -1,
564  -1,
565  inMPath->primitive(0)->channelId(),
566  inMPath->primitive(0)->tdcTimeStamp(),
567  latcomb[0],
568  inMPath->primitive(1)->channelId(),
569  inMPath->primitive(1)->tdcTimeStamp(),
570  latcomb[1],
571  inMPath->primitive(2)->channelId(),
572  inMPath->primitive(2)->tdcTimeStamp(),
573  latcomb[2],
574  inMPath->primitive(3)->channelId(),
575  inMPath->primitive(3)->tdcTimeStamp(),
576  latcomb[3],
577  -1,
578  -1,
579  -1,
580  -1,
581  -1,
582  -1,
583  -1,
584  -1,
585  -1,
586  -1,
587  -1,
588  -1,
589  -1}));
590  else
591  metaPrimitives[ch_muonpaths.first].emplace_back(metaPrimitive({MuonPathSLId.rawId(),
592  -1,
593  -1,
594  -1,
595  -1,
596  -1,
597  -1,
598  -1,
599  -1,
600  -1,
601  -1,
602  -1,
603  -1,
604  -1,
605  -1,
606  -1,
607  -1,
608  -1,
609  -1,
610  -1,
611  -1,
612  -1,
613  inMPath->primitive(0)->channelId(),
614  inMPath->primitive(0)->tdcTimeStamp(),
615  latcomb[0],
616  inMPath->primitive(1)->channelId(),
617  inMPath->primitive(1)->tdcTimeStamp(),
618  latcomb[1],
619  inMPath->primitive(2)->channelId(),
620  inMPath->primitive(2)->tdcTimeStamp(),
621  latcomb[2],
622  inMPath->primitive(3)->channelId(),
623  inMPath->primitive(3)->tdcTimeStamp(),
624  latcomb[3],
625  -1}));
626  }
627  }
628  }
629  }
630  } else {
631  // implementation for advanced (2SL) grouping, no filter required..
632  if (debug_)
633  LogDebug("DTTrigPhase2Prod") << "Fitting 2SL at once ";
634  for (auto& ch_muonpaths : muonpaths) {
635  mpathanalyzer_->run(iEvent, iEventSetup, ch_muonpaths.second, outmpaths[ch_muonpaths.first]);
636  }
637  }
638 
640 
641  if (dump_) {
642  for (auto& ch_outmpaths : outmpaths) {
643  for (unsigned int i = 0; i < ch_outmpaths.second.size(); i++) {
644  LogInfo("DTTrigPhase2Prod") << iEvent.id().event() << " mp " << i << ": "
645  << ch_outmpaths.second.at(i)->bxTimeValue() << " "
646  << ch_outmpaths.second.at(i)->horizPos() << " "
647  << ch_outmpaths.second.at(i)->tanPhi() << " " << ch_outmpaths.second.at(i)->phi()
648  << " " << ch_outmpaths.second.at(i)->phiB() << " "
649  << ch_outmpaths.second.at(i)->quality() << " "
650  << ch_outmpaths.second.at(i)->chiSquare();
651  }
652  }
653  for (auto& ch_metaPrimitives : metaPrimitives) {
654  for (unsigned int i = 0; i < ch_metaPrimitives.second.size(); i++) {
655  stringstream ss;
656  ss << iEvent.id().event() << " mp " << i << ": ";
657  printmP(ss.str(), ch_metaPrimitives.second.at(i));
658  }
659  }
660  }
661 
662  muonpaths.clear();
663  filteredmuonpaths.clear();
664 
668 
669  std::map<int, std::vector<metaPrimitive>> confirmedMetaPrimitives;
670  for (auto& ch_metaPrimitives : metaPrimitives) {
672  mpathconfirmator_->run(
673  iEvent, iEventSetup, ch_metaPrimitives.second, dtdigis, confirmedMetaPrimitives[ch_metaPrimitives.first]);
674  else
675  for (auto& mp : ch_metaPrimitives.second) {
676  confirmedMetaPrimitives[ch_metaPrimitives.first].push_back(mp);
677  }
678  }
679 
680  metaPrimitives.clear();
682 
684  // FILTER SECTIONS:
686 
687  if (debug_)
688  LogDebug("DTTrigPhase2Prod") << "declaring new vector for filtered" << std::endl;
689 
690  std::map<int, std::vector<metaPrimitive>> filteredMetaPrimitives;
691  if (algo_ == Standard)
692  for (auto& ch_confirmedMetaPrimitives : confirmedMetaPrimitives) {
693  if (!skip_processing_)
695  iEventSetup,
696  ch_confirmedMetaPrimitives.second,
697  filteredMetaPrimitives[ch_confirmedMetaPrimitives.first]);
698  else
699  for (auto& mp : ch_confirmedMetaPrimitives.second) {
700  filteredMetaPrimitives[ch_confirmedMetaPrimitives.first].push_back(mp);
701  }
702  }
703  if (dump_) {
704  for (auto& ch_filteredMetaPrimitives : filteredMetaPrimitives) {
705  for (unsigned int i = 0; i < ch_filteredMetaPrimitives.second.size(); i++) {
706  stringstream ss;
707  ss << iEvent.id().event() << " filtered mp " << i << ": ";
708  printmP(ss.str(), ch_filteredMetaPrimitives.second.at(i));
709  }
710  }
711  }
712 
714  confirmedMetaPrimitives.clear();
715 
716  if (debug_)
717  for (auto& ch_filteredMetaPrimitives : filteredMetaPrimitives) {
718  LogDebug("DTTrigPhase2Prod") << "DTp2 in event:" << iEvent.id().event() << " we found "
719  << ch_filteredMetaPrimitives.second.size() << " filteredMetaPrimitives (superlayer)"
720  << std::endl;
721  }
722  if (debug_)
723  LogDebug("DTTrigPhase2Prod") << "filteredMetaPrimitives: starting correlations" << std::endl;
724 
728 
729  std::map<int, std::vector<metaPrimitive>> correlatedMetaPrimitives;
730  if (algo_ == Standard) {
731  for (auto& ch_filteredMetaPrimitives : filteredMetaPrimitives) {
732  if (!skip_processing_)
734  iEventSetup,
735  ch_filteredMetaPrimitives.second,
736  correlatedMetaPrimitives[ch_filteredMetaPrimitives.first]);
737  else
738  for (auto& mp : ch_filteredMetaPrimitives.second) {
739  correlatedMetaPrimitives[ch_filteredMetaPrimitives.first].push_back(mp);
740  }
741  }
742  } else {
743  for (auto& ch_outmpaths : outmpaths) {
744  for (const auto& muonpath : ch_outmpaths.second) {
745  correlatedMetaPrimitives[ch_outmpaths.first].emplace_back(muonpath->rawId(),
746  (double)muonpath->bxTimeValue(),
747  muonpath->horizPos(),
748  muonpath->tanPhi(),
749  muonpath->phi(),
750  muonpath->phiB(),
751  muonpath->phi_cmssw(),
752  muonpath->phiB_cmssw(),
753  muonpath->chiSquare(),
754  (int)muonpath->quality(),
755  muonpath->primitive(0)->channelId(),
756  muonpath->primitive(0)->tdcTimeStamp(),
757  muonpath->primitive(0)->laterality(),
758  muonpath->primitive(1)->channelId(),
759  muonpath->primitive(1)->tdcTimeStamp(),
760  muonpath->primitive(1)->laterality(),
761  muonpath->primitive(2)->channelId(),
762  muonpath->primitive(2)->tdcTimeStamp(),
763  muonpath->primitive(2)->laterality(),
764  muonpath->primitive(3)->channelId(),
765  muonpath->primitive(3)->tdcTimeStamp(),
766  muonpath->primitive(3)->laterality(),
767  muonpath->primitive(4)->channelId(),
768  muonpath->primitive(4)->tdcTimeStamp(),
769  muonpath->primitive(4)->laterality(),
770  muonpath->primitive(5)->channelId(),
771  muonpath->primitive(5)->tdcTimeStamp(),
772  muonpath->primitive(5)->laterality(),
773  muonpath->primitive(6)->channelId(),
774  muonpath->primitive(6)->tdcTimeStamp(),
775  muonpath->primitive(6)->laterality(),
776  muonpath->primitive(7)->channelId(),
777  muonpath->primitive(7)->tdcTimeStamp(),
778  muonpath->primitive(7)->laterality());
779  }
780  }
781  }
782 
784 
785  if (debug_)
786  for (auto& ch_correlatedMetaPrimitives : correlatedMetaPrimitives) {
787  LogDebug("DTTrigPhase2Prod") << "DTp2 in event:" << iEvent.id().event() << " we found "
788  << ch_correlatedMetaPrimitives.second.size() << " correlatedMetPrimitives (chamber)";
789  }
790  if (dump_) {
791  for (auto& ch_correlatedMetaPrimitives : correlatedMetaPrimitives) {
792  LogDebug("DTTrigPhase2Prod") << "DTp2 in event:" << iEvent.id().event() << " we found "
793  << ch_correlatedMetaPrimitives.second.size() << " correlatedMetPrimitives (chamber)";
794  }
795  for (auto& ch_correlatedMetaPrimitives : correlatedMetaPrimitives) {
796  for (unsigned int i = 0; i < ch_correlatedMetaPrimitives.second.size(); i++) {
797  stringstream ss;
798  ss << iEvent.id().event() << " correlated mp " << i << ": ";
799  printmPC(ss.str(), ch_correlatedMetaPrimitives.second.at(i));
800  }
801  }
802  }
803 
804  // Correlated Filtering
805  std::map<int, std::vector<metaPrimitive>> filtCorrelatedMetaPrimitives;
806  if (algo_ == Standard) {
807  for (auto& ch_filteredMetaPrimitives : filteredMetaPrimitives) {
808  if (!skip_processing_)
809  mpathcorfilter_->run(iEvent,
810  iEventSetup,
811  ch_filteredMetaPrimitives.second,
812  correlatedMetaPrimitives[ch_filteredMetaPrimitives.first],
813  filtCorrelatedMetaPrimitives[ch_filteredMetaPrimitives.first]);
814  else {
815  for (auto& mp : ch_filteredMetaPrimitives.second) {
816  filtCorrelatedMetaPrimitives[ch_filteredMetaPrimitives.first].push_back(mp);
817  }
818  if (output_matcher_)
819  for (auto& mp : correlatedMetaPrimitives[ch_filteredMetaPrimitives.first]) {
820  filtCorrelatedMetaPrimitives[ch_filteredMetaPrimitives.first].push_back(mp);
821  }
822  }
823  }
824  }
825 
826  correlatedMetaPrimitives.clear();
827  filteredMetaPrimitives.clear();
828 
829  // Coincidence (co) filter
830 
831  std::vector<metaPrimitive> allMetaPrimitives;
832  for (auto& ch_filtcorrelatedMetaPrimitives : filtCorrelatedMetaPrimitives) {
833  for (const auto& metaPrimitiveIt : ch_filtcorrelatedMetaPrimitives.second) {
834  allMetaPrimitives.push_back(metaPrimitiveIt);
835  }
836  }
837 
838  std::map<int, std::vector<metaPrimitive>> coMetaPrimitives;
839  if (algo_ == Standard) {
840  for (auto& ch_filtcorrelatedMetaPrimitives : filtCorrelatedMetaPrimitives) {
841  if (!skip_processing_)
842  mpathcoifilter_->run(iEvent,
843  iEventSetup,
844  allMetaPrimitives,
845  filtCorrelatedMetaPrimitives[ch_filtcorrelatedMetaPrimitives.first],
846  coMetaPrimitives[ch_filtcorrelatedMetaPrimitives.first]);
847  else {
848  for (auto& mp : ch_filtcorrelatedMetaPrimitives.second) {
849  coMetaPrimitives[ch_filtcorrelatedMetaPrimitives.first].push_back(mp);
850  }
851  }
852  }
853  }
854 
855  allMetaPrimitives.clear();
856 
858 
859  double shift_back = 0;
860  if (scenario_ == MC) //scope for MC
861  shift_back = 400;
862  else if (scenario_ == DATA) //scope for data
863  shift_back = 0;
864  else if (scenario_ == SLICE_TEST) //scope for slice test
865  shift_back = 400;
866 
867  // RPC integration
868  if (useRPC_) {
869  rpc_integrator_->initialise(iEventSetup, shift_back);
870  rpc_integrator_->prepareMetaPrimitives(rpcRecHits);
871  for (auto& ch_correlatedMetaPrimitives : coMetaPrimitives) {
872  rpc_integrator_->matchWithDTAndUseRPCTime(ch_correlatedMetaPrimitives.second); // Probably this is a FIXME
873  }
874  rpc_integrator_->makeRPCOnlySegments();
875  rpc_integrator_->storeRPCSingleHits();
876  rpc_integrator_->removeRPCHitsUsed();
877  }
878 
880  vector<L1Phase2MuDTPhDigi> outP2Ph;
881  vector<L1Phase2MuDTExtPhDigi> outExtP2Ph;
882  vector<L1Phase2MuDTThDigi> outP2Th;
883  vector<L1Phase2MuDTExtThDigi> outExtP2Th;
884 
885  // Assigning index value
886  if (!skip_processing_)
887  for (auto& ch_correlatedMetaPrimitives : coMetaPrimitives) {
888  assignIndex(ch_correlatedMetaPrimitives.second);
889  }
890 
891  for (auto& ch_correlatedMetaPrimitives : coMetaPrimitives) {
892  for (const auto& metaPrimitiveIt : ch_correlatedMetaPrimitives.second) {
893  DTChamberId chId(metaPrimitiveIt.rawId);
894  DTSuperLayerId slId(metaPrimitiveIt.rawId);
895  if (debug_)
896  LogDebug("DTTrigPhase2Prod") << "looping in final vector: SuperLayerId" << chId << " x=" << metaPrimitiveIt.x
897  << " quality=" << metaPrimitiveIt.quality
898  << " BX=" << round(metaPrimitiveIt.t0 / 25.) << " index=" << metaPrimitiveIt.index;
899 
900  int sectorTP = chId.sector();
901  //sectors 13 and 14 exist only for the outermost stations for sectors 4 and 10 respectively
902  //due to the larger MB4 that are divided into two.
903  if (sectorTP == 13)
904  sectorTP = 4;
905  if (sectorTP == 14)
906  sectorTP = 10;
907  sectorTP = sectorTP - 1;
908  int sl = 0;
909  if (metaPrimitiveIt.quality < LOWLOWQ || metaPrimitiveIt.quality == CHIGHQ) {
910  if (inner(metaPrimitiveIt))
911  sl = 1;
912  else
913  sl = 3;
914  }
915 
916  float tp_t0 =
917  (metaPrimitiveIt.t0 - shift_back * LHC_CLK_FREQ) * ((float)TIME_TO_TDC_COUNTS / (float)LHC_CLK_FREQ);
918 
919  if (debug_)
920  LogDebug("DTTrigPhase2Prod") << "pushing back phase-2 dataformat carlo-federica dataformat";
921 
922  if (slId.superLayer() != 2) {
923  if (df_extended_ == 1 || df_extended_ == 2) {
924  int pathWireId[8] = {metaPrimitiveIt.wi1,
925  metaPrimitiveIt.wi2,
926  metaPrimitiveIt.wi3,
927  metaPrimitiveIt.wi4,
928  metaPrimitiveIt.wi5,
929  metaPrimitiveIt.wi6,
930  metaPrimitiveIt.wi7,
931  metaPrimitiveIt.wi8};
932 
933  int pathTDC[8] = {max((int)round(metaPrimitiveIt.tdc1 - shift_back * LHC_CLK_FREQ), -1),
934  max((int)round(metaPrimitiveIt.tdc2 - shift_back * LHC_CLK_FREQ), -1),
935  max((int)round(metaPrimitiveIt.tdc3 - shift_back * LHC_CLK_FREQ), -1),
936  max((int)round(metaPrimitiveIt.tdc4 - shift_back * LHC_CLK_FREQ), -1),
937  max((int)round(metaPrimitiveIt.tdc5 - shift_back * LHC_CLK_FREQ), -1),
938  max((int)round(metaPrimitiveIt.tdc6 - shift_back * LHC_CLK_FREQ), -1),
939  max((int)round(metaPrimitiveIt.tdc7 - shift_back * LHC_CLK_FREQ), -1),
940  max((int)round(metaPrimitiveIt.tdc8 - shift_back * LHC_CLK_FREQ), -1)};
941 
942  int pathLat[8] = {metaPrimitiveIt.lat1,
943  metaPrimitiveIt.lat2,
944  metaPrimitiveIt.lat3,
945  metaPrimitiveIt.lat4,
946  metaPrimitiveIt.lat5,
947  metaPrimitiveIt.lat6,
948  metaPrimitiveIt.lat7,
949  metaPrimitiveIt.lat8};
950 
951  // phiTP (extended DF)
952  outExtP2Ph.emplace_back(
953  L1Phase2MuDTExtPhDigi((int)round(metaPrimitiveIt.t0 / (float)LHC_CLK_FREQ) - shift_back,
954  chId.wheel(), // uwh (m_wheel)
955  sectorTP, // usc (m_sector)
956  chId.station(), // ust (m_station)
957  sl, // ust (m_station)
958  (int)round(metaPrimitiveIt.phi * PHIRES_CONV), // uphi (m_phiAngle)
959  (int)round(metaPrimitiveIt.phiB * PHIBRES_CONV), // uphib (m_phiBending)
960  metaPrimitiveIt.quality, // uqua (m_qualityCode)
961  metaPrimitiveIt.index, // uind (m_segmentIndex)
962  tp_t0, // ut0 (m_t0Segment)
963  (int)round(metaPrimitiveIt.chi2 * CHI2RES_CONV), // uchi2 (m_chi2Segment)
964  (int)round(metaPrimitiveIt.x * 1000), // ux (m_xLocal)
965  (int)round(metaPrimitiveIt.tanPhi * 1000), // utan (m_tanPsi)
966  (int)round(metaPrimitiveIt.phi_cmssw * PHIRES_CONV), // uphi (m_phiAngleCMSSW)
967  (int)round(metaPrimitiveIt.phiB_cmssw * PHIBRES_CONV), // uphib (m_phiBendingCMSSW)
968  metaPrimitiveIt.rpcFlag, // urpc (m_rpcFlag)
969  pathWireId,
970  pathTDC,
971  pathLat));
972  }
973  if (df_extended_ == 0 || df_extended_ == 2) {
974  // phiTP (standard DF)
975  outP2Ph.push_back(L1Phase2MuDTPhDigi(
976  (int)round(metaPrimitiveIt.t0 / (float)LHC_CLK_FREQ) - shift_back,
977  chId.wheel(), // uwh (m_wheel)
978  sectorTP, // usc (m_sector)
979  chId.station(), // ust (m_station)
980  sl, // ust (m_station)
981  (int)round(metaPrimitiveIt.phi * PHIRES_CONV), // uphi (_phiAngle)
982  (int)round(metaPrimitiveIt.phiB * PHIBRES_CONV), // uphib (m_phiBending)
983  metaPrimitiveIt.quality, // uqua (m_qualityCode)
984  metaPrimitiveIt.index, // uind (m_segmentIndex)
985  tp_t0, // ut0 (m_t0Segment)
986  (int)round(metaPrimitiveIt.chi2 * CHI2RES_CONV), // uchi2 (m_chi2Segment)
987  metaPrimitiveIt.rpcFlag // urpc (m_rpcFlag)
988  ));
989  }
990  } else {
991  if (df_extended_ == 1 || df_extended_ == 2) {
992  int pathWireId[4] = {metaPrimitiveIt.wi1, metaPrimitiveIt.wi2, metaPrimitiveIt.wi3, metaPrimitiveIt.wi4};
993 
994  int pathTDC[4] = {max((int)round(metaPrimitiveIt.tdc1 - shift_back * LHC_CLK_FREQ), -1),
995  max((int)round(metaPrimitiveIt.tdc2 - shift_back * LHC_CLK_FREQ), -1),
996  max((int)round(metaPrimitiveIt.tdc3 - shift_back * LHC_CLK_FREQ), -1),
997  max((int)round(metaPrimitiveIt.tdc4 - shift_back * LHC_CLK_FREQ), -1)};
998 
999  int pathLat[4] = {metaPrimitiveIt.lat1, metaPrimitiveIt.lat2, metaPrimitiveIt.lat3, metaPrimitiveIt.lat4};
1000 
1001  // thTP (extended DF)
1002  outExtP2Th.emplace_back(
1003  L1Phase2MuDTExtThDigi((int)round(metaPrimitiveIt.t0 / (float)LHC_CLK_FREQ) - shift_back,
1004  chId.wheel(), // uwh (m_wheel)
1005  sectorTP, // usc (m_sector)
1006  chId.station(), // ust (m_station)
1007  (int)round(metaPrimitiveIt.phi * ZRES_CONV), // uz (m_zGlobal)
1008  (int)round(metaPrimitiveIt.phiB * KRES_CONV), // uk (m_kSlope)
1009  metaPrimitiveIt.quality, // uqua (m_qualityCode)
1010  metaPrimitiveIt.index, // uind (m_segmentIndex)
1011  tp_t0, // ut0 (m_t0Segment)
1012  (int)round(metaPrimitiveIt.chi2 * CHI2RES_CONV), // uchi2 (m_chi2Segment)
1013  (int)round(metaPrimitiveIt.x * 1000), // ux (m_yLocal)
1014  (int)round(metaPrimitiveIt.phi_cmssw * ZRES_CONV), // uphi (m_zCMSSW)
1015  (int)round(metaPrimitiveIt.phiB_cmssw * KRES_CONV), // uphib (m_kCMSSW)
1016  metaPrimitiveIt.rpcFlag, // urpc (m_rpcFlag)
1017  pathWireId,
1018  pathTDC,
1019  pathLat));
1020  }
1021  if (df_extended_ == 0 || df_extended_ == 2) {
1022  // thTP (standard DF)
1023  outP2Th.push_back(L1Phase2MuDTThDigi(
1024  (int)round(metaPrimitiveIt.t0 / (float)LHC_CLK_FREQ) - shift_back,
1025  chId.wheel(), // uwh (m_wheel)
1026  sectorTP, // usc (m_sector)
1027  chId.station(), // ust (m_station)
1028  (int)round(metaPrimitiveIt.phi * ZRES_CONV), // uz (m_zGlobal)
1029  (int)round(metaPrimitiveIt.phiB * KRES_CONV), // uk (m_kSlope)
1030  metaPrimitiveIt.quality, // uqua (m_qualityCode)
1031  metaPrimitiveIt.index, // uind (m_segmentIndex)
1032  tp_t0, // ut0 (m_t0Segment)
1033  (int)round(metaPrimitiveIt.chi2 * CHI2RES_CONV), // uchi2 (m_chi2Segment)
1034  metaPrimitiveIt.rpcFlag // urpc (m_rpcFlag)
1035  ));
1036  }
1037  }
1038  }
1039  }
1040 
1041  // Storing RPC hits that were not used elsewhere
1042  if (useRPC_) {
1043  for (auto rpc_dt_digi = rpc_integrator_->rpcRecHits_translated_.begin();
1044  rpc_dt_digi != rpc_integrator_->rpcRecHits_translated_.end();
1045  rpc_dt_digi++) {
1046  outP2Ph.push_back(*rpc_dt_digi);
1047  }
1048  }
1049 
1050  // Storing Phi results
1051  if (df_extended_ == 1 || df_extended_ == 2) {
1052  std::unique_ptr<L1Phase2MuDTExtPhContainer> resultExtP2Ph(new L1Phase2MuDTExtPhContainer);
1053  resultExtP2Ph->setContainer(outExtP2Ph);
1054  iEvent.put(std::move(resultExtP2Ph));
1055  }
1056  if (df_extended_ == 0 || df_extended_ == 2) {
1057  std::unique_ptr<L1Phase2MuDTPhContainer> resultP2Ph(new L1Phase2MuDTPhContainer);
1058  resultP2Ph->setContainer(outP2Ph);
1059  iEvent.put(std::move(resultP2Ph));
1060  }
1061  outExtP2Ph.clear();
1062  outExtP2Ph.erase(outExtP2Ph.begin(), outExtP2Ph.end());
1063  outP2Ph.clear();
1064  outP2Ph.erase(outP2Ph.begin(), outP2Ph.end());
1065 
1066  // Storing Theta results
1067  if (df_extended_ == 1 || df_extended_ == 2) {
1068  std::unique_ptr<L1Phase2MuDTExtThContainer> resultExtP2Th(new L1Phase2MuDTExtThContainer);
1069  resultExtP2Th->setContainer(outExtP2Th);
1070  iEvent.put(std::move(resultExtP2Th));
1071  }
1072  if (df_extended_ == 0 || df_extended_ == 2) {
1073  std::unique_ptr<L1Phase2MuDTThContainer> resultP2Th(new L1Phase2MuDTThContainer);
1074  resultP2Th->setContainer(outP2Th);
1075  iEvent.put(std::move(resultP2Th));
1076  }
1077  outExtP2Th.clear();
1078  outExtP2Th.erase(outExtP2Th.begin(), outExtP2Th.end());
1079  outP2Th.clear();
1080  outP2Th.erase(outP2Th.begin(), outP2Th.end());
1081 }
std::unique_ptr< MotherGrouping > grouping_obj_
std::map< DTChamberId, DTDigiCollection, std::less< DTChamberId > > DTDigiMap
constexpr int CHI2RES_CONV
Definition: constants.h:365
constexpr float PHIBRES_CONV
Definition: constants.h:364
DTChamberId id() const
Return the DTChamberId of this chamber.
Definition: DTChamber.cc:32
std::unique_ptr< LateralityProvider > latprovider_
std::unique_ptr< MPFilter > mpathhitsfilter_
edm::EDGetTokenT< DTDigiCollection > dtDigisToken_
std::vector< DTDigiCollection * > distribDigis(std::queue< std::pair< DTLayerId, DTDigi >> &inQ)
std::unique_ptr< RPCIntegrator > rpc_integrator_
std::unique_ptr< MuonPathConfirmator > mpathconfirmator_
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitsLabel_
std::vector< short > latcomb
void assignIndex(std::vector< metaPrimitive > &inMPaths)
const DTGeometry * dtGeo_
int iEvent
Definition: GenABIO.cc:224
void printmPC(const std::string &ss, const metaPrimitive &mP) const
DTChamberId chamberId() const
Return the corresponding ChamberId.
bool inner(const metaPrimitive &mp) const
std::unique_ptr< MuonPathAnalyzer > mpathanalyzer_
constexpr float KRES_CONV
Definition: constants.h:368
std::unique_ptr< MPFilter > mpathqualityenhancer_
void printmP(const std::string &ss, const metaPrimitive &mP) const
constexpr float ZRES_CONV
Definition: constants.h:367
std::unique_ptr< MPFilter > mpathcoifilter_
std::unique_ptr< MPFilter > mpathcorfilter_
Log< level::Info, false > LogInfo
std::unique_ptr< MPFilter > mpathredundantfilter_
constexpr int TIME_TO_TDC_COUNTS
Definition: constants.h:235
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::pair< const_iterator, const_iterator > Range
std::unique_ptr< MuonPathAnalyzer > mpathassociator_
std::vector< DigiType >::const_iterator const_iterator
constexpr int LHC_CLK_FREQ
Definition: constants.h:222
DTDigiMap::iterator DTDigiMap_iterator
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:48
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
constexpr float PHIRES_CONV
Definition: constants.h:363
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

◆ rango()

int DTTrigPhase2Prod::rango ( const metaPrimitive mp) const

Definition at line 1160 of file DTTrigPhase2Prod.cc.

References or, and cmsdt::metaPrimitive::quality.

Referenced by printmP(), and printmPC().

1160  {
1161  if (mp.quality == 1 or mp.quality == 2)
1162  return 3;
1163  if (mp.quality == 3 or mp.quality == 4)
1164  return 4;
1165  return mp.quality;
1166 }
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

◆ setChiSquareThreshold()

void DTTrigPhase2Prod::setChiSquareThreshold ( float  ch2Thr)

◆ setMinimumQuality()

void DTTrigPhase2Prod::setMinimumQuality ( MP_QUALITY  q)

Member Data Documentation

◆ activateBuffer_

bool DTTrigPhase2Prod::activateBuffer_
private

Definition at line 172 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ algo_

int DTTrigPhase2Prod::algo_
private

Definition at line 157 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ allow_confirmation_

bool DTTrigPhase2Prod::allow_confirmation_
private

Definition at line 150 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ co_option_

int DTTrigPhase2Prod::co_option_
private

Definition at line 139 of file DTTrigPhase2Prod.cc.

◆ co_quality_

int DTTrigPhase2Prod::co_quality_
private

Definition at line 140 of file DTTrigPhase2Prod.cc.

◆ debug_

bool DTTrigPhase2Prod::debug_
private

Definition at line 134 of file DTTrigPhase2Prod.cc.

Referenced by beginRun(), produce(), and ~DTTrigPhase2Prod().

◆ df_extended_

int DTTrigPhase2Prod::df_extended_
private

Definition at line 138 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ dT0_correlate_TP_

double DTTrigPhase2Prod::dT0_correlate_TP_
private

Definition at line 136 of file DTTrigPhase2Prod.cc.

◆ dtDigisToken_

edm::EDGetTokenT<DTDigiCollection> DTTrigPhase2Prod::dtDigisToken_
private

Definition at line 153 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ dtGeo_

const DTGeometry* DTTrigPhase2Prod::dtGeo_

Definition at line 122 of file DTTrigPhase2Prod.cc.

Referenced by beginRun(), and produce().

◆ dtGeomH

edm::ESGetToken<DTGeometry, MuonGeometryRecord> DTTrigPhase2Prod::dtGeomH

Definition at line 123 of file DTTrigPhase2Prod.cc.

Referenced by beginRun().

◆ dump_

bool DTTrigPhase2Prod::dump_
private

Definition at line 135 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ globalcoordsobtainer_

std::shared_ptr<GlobalCoordsObtainer> DTTrigPhase2Prod::globalcoordsobtainer_
private

Definition at line 169 of file DTTrigPhase2Prod.cc.

◆ grouping_obj_

std::unique_ptr<MotherGrouping> DTTrigPhase2Prod::grouping_obj_
private

Definition at line 158 of file DTTrigPhase2Prod.cc.

Referenced by beginRun(), endRun(), and produce().

◆ latprovider_

std::unique_ptr<LateralityProvider> DTTrigPhase2Prod::latprovider_
private

Definition at line 160 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ max_index_

int DTTrigPhase2Prod::max_index_
private

Definition at line 141 of file DTTrigPhase2Prod.cc.

Referenced by assignIndex().

◆ mpathanalyzer_

std::unique_ptr<MuonPathAnalyzer> DTTrigPhase2Prod::mpathanalyzer_
private

Definition at line 159 of file DTTrigPhase2Prod.cc.

Referenced by beginRun(), endRun(), and produce().

◆ mpathassociator_

std::unique_ptr<MuonPathAnalyzer> DTTrigPhase2Prod::mpathassociator_
private

Definition at line 165 of file DTTrigPhase2Prod.cc.

Referenced by beginRun(), endRun(), and produce().

◆ mpathcoifilter_

std::unique_ptr<MPFilter> DTTrigPhase2Prod::mpathcoifilter_
private

Definition at line 168 of file DTTrigPhase2Prod.cc.

Referenced by beginRun(), and produce().

◆ mpathconfirmator_

std::unique_ptr<MuonPathConfirmator> DTTrigPhase2Prod::mpathconfirmator_
private

Definition at line 166 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ mpathcorfilter_

std::unique_ptr<MPFilter> DTTrigPhase2Prod::mpathcorfilter_
private

Definition at line 167 of file DTTrigPhase2Prod.cc.

Referenced by beginRun(), and produce().

◆ mpathhitsfilter_

std::unique_ptr<MPFilter> DTTrigPhase2Prod::mpathhitsfilter_
private

Definition at line 164 of file DTTrigPhase2Prod.cc.

Referenced by beginRun(), endRun(), and produce().

◆ mpathqualityenhancer_

std::unique_ptr<MPFilter> DTTrigPhase2Prod::mpathqualityenhancer_
private

Definition at line 161 of file DTTrigPhase2Prod.cc.

Referenced by beginRun(), endRun(), and produce().

◆ mpathqualityenhancerbayes_

std::unique_ptr<MPFilter> DTTrigPhase2Prod::mpathqualityenhancerbayes_
private

Definition at line 162 of file DTTrigPhase2Prod.cc.

Referenced by beginRun(), and endRun().

◆ mpathredundantfilter_

std::unique_ptr<MPFilter> DTTrigPhase2Prod::mpathredundantfilter_
private

Definition at line 163 of file DTTrigPhase2Prod.cc.

Referenced by beginRun(), endRun(), and produce().

◆ my_BXoffset_

int DTTrigPhase2Prod::my_BXoffset_
private

Definition at line 131 of file DTTrigPhase2Prod.cc.

◆ my_CCBValid_

bool DTTrigPhase2Prod::my_CCBValid_
private

Definition at line 128 of file DTTrigPhase2Prod.cc.

◆ output_confirmed_

bool DTTrigPhase2Prod::output_confirmed_
private

Definition at line 147 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ output_latpredictor_

bool DTTrigPhase2Prod::output_latpredictor_
private

Definition at line 144 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ output_matcher_

bool DTTrigPhase2Prod::output_matcher_
private

Definition at line 148 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ output_mixer_

bool DTTrigPhase2Prod::output_mixer_
private

Definition at line 143 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ output_slfilter_

bool DTTrigPhase2Prod::output_slfilter_
private

Definition at line 146 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ output_slfitter_

bool DTTrigPhase2Prod::output_slfitter_
private

Definition at line 145 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ primitives_

std::vector<std::pair<int, MuonPath> > DTTrigPhase2Prod::primitives_

Definition at line 124 of file DTTrigPhase2Prod.cc.

◆ qmap_

const std::unordered_map<int, int> DTTrigPhase2Prod::qmap_
private

Definition at line 187 of file DTTrigPhase2Prod.cc.

Referenced by assignQualityOrder().

◆ rpc_integrator_

std::unique_ptr<RPCIntegrator> DTTrigPhase2Prod::rpc_integrator_
private

Definition at line 180 of file DTTrigPhase2Prod.cc.

Referenced by endRun(), and produce().

◆ rpcRecHitsLabel_

edm::EDGetTokenT<RPCRecHitCollection> DTTrigPhase2Prod::rpcRecHitsLabel_
private

Definition at line 154 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ scenario_

int DTTrigPhase2Prod::scenario_
private

Definition at line 137 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ skip_processing_

bool DTTrigPhase2Prod::skip_processing_
private

Definition at line 149 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ superCellhalfspacewidth_

int DTTrigPhase2Prod::superCellhalfspacewidth_
private

Definition at line 173 of file DTTrigPhase2Prod.cc.

Referenced by processDigi().

◆ superCelltimewidth_

float DTTrigPhase2Prod::superCelltimewidth_
private

Definition at line 174 of file DTTrigPhase2Prod.cc.

Referenced by processDigi().

◆ useRPC_

bool DTTrigPhase2Prod::useRPC_
private

Definition at line 181 of file DTTrigPhase2Prod.cc.

Referenced by produce().