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 printmPC (const std::string &ss, 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 debug_
 
int df_extended_
 
double dT0_correlate_TP_
 
edm::EDGetTokenT< DTDigiCollectiondtDigisToken_
 
bool dump_
 
std::shared_ptr< GlobalCoordsObtainerglobalcoordsobtainer_
 
std::unique_ptr< MotherGroupinggrouping_obj_
 
int max_index_
 
std::unique_ptr< MuonPathAnalyzermpathanalyzer_
 
std::unique_ptr< MuonPathAssociatormpathassociator_
 
std::unique_ptr< MPFiltermpathhitsfilter_
 
std::unique_ptr< MPFiltermpathqualityenhancer_
 
std::unique_ptr< MPFiltermpathqualityenhancerbayes_
 
std::unique_ptr< MPFiltermpathredundantfilter_
 
int my_BXoffset_
 
bool my_CCBValid_
 
const std::unordered_map< int, int > qmap_
 
std::unique_ptr< RPCIntegratorrpc_integrator_
 
edm::EDGetTokenT< RPCRecHitCollectionrpcRecHitsLabel_
 
int scenario_
 
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 72 of file DTTrigPhase2Prod.cc.

Member Typedef Documentation

◆ DTDigiMap

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

Definition at line 73 of file DTTrigPhase2Prod.cc.

◆ DTDigiMap_const_iterator

typedef DTDigiMap::const_iterator DTTrigPhase2Prod::DTDigiMap_const_iterator
private

Definition at line 75 of file DTTrigPhase2Prod.cc.

◆ DTDigiMap_iterator

typedef DTDigiMap::iterator DTTrigPhase2Prod::DTDigiMap_iterator
private

Definition at line 74 of file DTTrigPhase2Prod.cc.

Constructor & Destructor Documentation

◆ DTTrigPhase2Prod()

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

Constructor.

Definition at line 172 of file DTTrigPhase2Prod.cc.

173  : qmap_({{8, 8}, {7, 7}, {6, 6}, {4, 4}, {3, 3}, {2, 2}, {1, 1}}) {
174  produces<L1Phase2MuDTPhContainer>();
175  produces<L1Phase2MuDTThContainer>();
176  produces<L1Phase2MuDTExtPhContainer>();
177  produces<L1Phase2MuDTExtThContainer>();
178 
179  debug_ = pset.getUntrackedParameter<bool>("debug");
180  dump_ = pset.getUntrackedParameter<bool>("dump");
181 
182  scenario_ = pset.getParameter<int>("scenario");
183 
184  df_extended_ = pset.getParameter<int>("df_extended");
185  max_index_ = pset.getParameter<int>("max_primitives") - 1;
186 
187  dtDigisToken_ = consumes<DTDigiCollection>(pset.getParameter<edm::InputTag>("digiTag"));
188 
189  rpcRecHitsLabel_ = consumes<RPCRecHitCollection>(pset.getParameter<edm::InputTag>("rpcRecHits"));
190  useRPC_ = pset.getParameter<bool>("useRPC");
191 
192  // Choosing grouping scheme:
193  algo_ = pset.getParameter<int>("algo");
194 
195  edm::ConsumesCollector consumesColl(consumesCollector());
196  globalcoordsobtainer_ = std::make_shared<GlobalCoordsObtainer>(pset);
197  globalcoordsobtainer_->generate_luts();
198 
199  if (algo_ == PseudoBayes) {
200  grouping_obj_ =
201  std::make_unique<PseudoBayesGrouping>(pset.getParameter<edm::ParameterSet>("PseudoBayesPattern"), consumesColl);
202  } else if (algo_ == HoughTrans) {
203  grouping_obj_ =
204  std::make_unique<HoughGrouping>(pset.getParameter<edm::ParameterSet>("HoughGrouping"), consumesColl);
205  } else {
206  grouping_obj_ = std::make_unique<InitialGrouping>(pset, consumesColl);
207  }
208 
209  if (algo_ == Standard) {
210  if (debug_)
211  LogDebug("DTTrigPhase2Prod") << "DTp2:constructor: JM analyzer";
212  mpathanalyzer_ = std::make_unique<MuonPathAnalyticAnalyzer>(pset, consumesColl, globalcoordsobtainer_);
213  } else {
214  if (debug_)
215  LogDebug("DTTrigPhase2Prod") << "DTp2:constructor: Full chamber analyzer";
216  mpathanalyzer_ = std::make_unique<MuonPathAnalyzerInChamber>(pset, consumesColl, globalcoordsobtainer_);
217  }
218 
219  // Getting buffer option
220  activateBuffer_ = pset.getParameter<bool>("activateBuffer");
221  superCellhalfspacewidth_ = pset.getParameter<int>("superCellspacewidth") / 2;
222  superCelltimewidth_ = pset.getParameter<double>("superCelltimewidth");
223 
224  mpathqualityenhancer_ = std::make_unique<MPQualityEnhancerFilter>(pset);
225  mpathqualityenhancerbayes_ = std::make_unique<MPQualityEnhancerFilterBayes>(pset);
226  mpathredundantfilter_ = std::make_unique<MPRedundantFilter>(pset);
227  mpathhitsfilter_ = std::make_unique<MPCleanHitsFilter>(pset);
228  mpathassociator_ = std::make_unique<MuonPathAssociator>(pset, consumesColl, globalcoordsobtainer_);
229  rpc_integrator_ = std::make_unique<RPCIntegrator>(pset, consumesColl);
230 
231  dtGeomH = esConsumes<DTGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
232 }
std::unique_ptr< MotherGrouping > grouping_obj_
std::unique_ptr< MPFilter > mpathhitsfilter_
edm::EDGetTokenT< DTDigiCollection > dtDigisToken_
std::unique_ptr< RPCIntegrator > rpc_integrator_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomH
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitsLabel_
std::unique_ptr< MuonPathAnalyzer > mpathanalyzer_
std::unique_ptr< MPFilter > mpathqualityenhancer_
std::unique_ptr< MuonPathAssociator > mpathassociator_
std::unique_ptr< MPFilter > mpathredundantfilter_
std::shared_ptr< GlobalCoordsObtainer > globalcoordsobtainer_
std::unique_ptr< MPFilter > mpathqualityenhancerbayes_
const std::unordered_map< int, int > qmap_
#define LogDebug(id)

◆ ~DTTrigPhase2Prod()

DTTrigPhase2Prod::~DTTrigPhase2Prod ( )
override

Destructor.

Definition at line 234 of file DTTrigPhase2Prod.cc.

References debug_, and LogDebug.

234  {
235  if (debug_)
236  LogDebug("DTTrigPhase2Prod") << "DTp2: calling destructor" << std::endl;
237 }
#define LogDebug(id)

Member Function Documentation

◆ assignIndex()

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

Definition at line 775 of file DTTrigPhase2Prod.cc.

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

Referenced by produce().

775  {
776  std::map<int, std::vector<metaPrimitive>> primsPerBX;
777  for (const auto& metaPrimitive : inMPaths) {
778  int BX = round(metaPrimitive.t0 / 25.);
779  primsPerBX[BX].push_back(metaPrimitive);
780  }
781  inMPaths.clear();
782  for (auto& prims : primsPerBX) {
783  assignIndexPerBX(prims.second);
784  for (const auto& primitive : prims.second)
785  if (primitive.index <= max_index_)
786  inMPaths.push_back(primitive);
787  }
788 }
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 790 of file DTTrigPhase2Prod.cc.

References funct::abs(), assignQualityOrder(), and dqmiodatasetharvest::inf.

Referenced by assignIndex().

790  {
791  // First we asociate a new index to the metaprimitive depending on quality or phiB;
792  uint32_t rawId = -1;
793  int numP = -1;
794  for (auto& metaPrimitiveIt : inMPaths) {
795  numP++;
796  rawId = metaPrimitiveIt.rawId;
797  int iOrder = assignQualityOrder(metaPrimitiveIt);
798  int inf = 0;
799  int numP2 = -1;
800  for (auto& metaPrimitiveItN : inMPaths) {
801  int nOrder = assignQualityOrder(metaPrimitiveItN);
802  numP2++;
803  if (rawId != metaPrimitiveItN.rawId)
804  continue;
805  if (numP2 == numP) {
806  metaPrimitiveIt.index = inf;
807  break;
808  } else if (iOrder < nOrder) {
809  inf++;
810  } else if (iOrder > nOrder) {
811  metaPrimitiveItN.index++;
812  } else if (iOrder == nOrder) {
813  if (std::abs(metaPrimitiveIt.phiB) >= std::abs(metaPrimitiveItN.phiB)) {
814  inf++;
815  } else if (std::abs(metaPrimitiveIt.phiB) < std::abs(metaPrimitiveItN.phiB)) {
816  metaPrimitiveItN.index++;
817  }
818  }
819  } // ending second for
820  } // ending first for
821 }
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 823 of file DTTrigPhase2Prod.cc.

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

Referenced by assignIndexPerBX().

823  {
824  if (mP.quality > 8 || mP.quality < 1)
825  return -1;
826 
827  return qmap_.find(mP.quality)->second;
828 }
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 239 of file DTTrigPhase2Prod.cc.

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

239  {
240  if (debug_)
241  LogDebug("DTTrigPhase2Prod") << "beginRun " << iRun.id().run();
242  if (debug_)
243  LogDebug("DTTrigPhase2Prod") << "beginRun: getting DT geometry";
244 
245  grouping_obj_->initialise(iEventSetup); // Grouping object initialisation
246  mpathanalyzer_->initialise(iEventSetup); // Analyzer object initialisation
247  mpathqualityenhancer_->initialise(iEventSetup); // Filter object initialisation
248  mpathredundantfilter_->initialise(iEventSetup); // Filter object initialisation
249  mpathqualityenhancerbayes_->initialise(iEventSetup); // Filter object initialisation
250  mpathhitsfilter_->initialise(iEventSetup);
251  mpathassociator_->initialise(iEventSetup); // Associator object initialisation
252 
253  if (auto geom = iEventSetup.getHandle(dtGeomH)) {
254  dtGeo_ = &(*geom);
255  }
256 }
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_
std::unique_ptr< MuonPathAssociator > mpathassociator_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
std::unique_ptr< MPFilter > mpathredundantfilter_
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 830 of file DTTrigPhase2Prod.cc.

References processDigi().

Referenced by produce().

830  {
831  std::vector<std::queue<std::pair<DTLayerId, DTDigi>>*> tmpVector;
832  tmpVector.clear();
833  std::vector<DTDigiCollection*> collVector;
834  collVector.clear();
835  while (!inQ.empty()) {
836  processDigi(inQ, tmpVector);
837  }
838  for (auto& sQ : tmpVector) {
839  DTDigiCollection tmpColl;
840  while (!sQ->empty()) {
841  tmpColl.insertDigi((sQ->front().first), (sQ->front().second));
842  sQ->pop();
843  }
844  collVector.push_back(&tmpColl);
845  }
846  return collVector;
847 }
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 717 of file DTTrigPhase2Prod.cc.

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

717  {
718  grouping_obj_->finish();
719  mpathanalyzer_->finish();
720  mpathqualityenhancer_->finish();
721  mpathqualityenhancerbayes_->finish();
722  mpathredundantfilter_->finish();
723  mpathhitsfilter_->finish();
724  mpathassociator_->finish();
725  rpc_integrator_->finish();
726 };
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< MuonPathAssociator > mpathassociator_
std::unique_ptr< MPFilter > mpathredundantfilter_
std::unique_ptr< MPFilter > mpathqualityenhancerbayes_

◆ fillDescriptions()

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

Definition at line 879 of file DTTrigPhase2Prod.cc.

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

879  {
880  // dtTriggerPhase2PrimitiveDigis
882  desc.add<edm::InputTag>("digiTag", edm::InputTag("CalibratedDigis"));
883  desc.add<int>("trigger_with_sl", 4);
884  desc.add<int>("timeTolerance", 999999);
885  desc.add<double>("tanPhiTh", 1.0);
886  desc.add<double>("tanPhiThw2max", 1.3);
887  desc.add<double>("tanPhiThw2min", 0.5);
888  desc.add<double>("tanPhiThw1max", 0.9);
889  desc.add<double>("tanPhiThw1min", 0.2);
890  desc.add<double>("tanPhiThw0", 0.5);
891  desc.add<double>("chi2Th", 0.01);
892  desc.add<double>("chi2corTh", 0.1);
893  desc.add<bool>("useBX_correlation", false);
894  desc.add<double>("dT0_correlate_TP", 25.0);
895  desc.add<int>("dBX_correlate_TP", 0);
896  desc.add<double>("dTanPsi_correlate_TP", 99999.0);
897  desc.add<bool>("clean_chi2_correlation", true);
898  desc.add<bool>("allow_confirmation", true);
899  desc.add<double>("minx_match_2digis", 1.0);
900  desc.add<int>("scenario", 0);
901  desc.add<int>("df_extended", 0);
902  desc.add<int>("max_primitives", 999);
903  desc.add<edm::FileInPath>("ttrig_filename", edm::FileInPath("L1Trigger/DTTriggerPhase2/data/wire_rawId_ttrig.txt"));
904  desc.add<edm::FileInPath>("z_filename", edm::FileInPath("L1Trigger/DTTriggerPhase2/data/wire_rawId_z.txt"));
905  desc.add<edm::FileInPath>("shift_filename", edm::FileInPath("L1Trigger/DTTriggerPhase2/data/wire_rawId_x.txt"));
906  desc.add<edm::FileInPath>("shift_theta_filename", edm::FileInPath("L1Trigger/DTTriggerPhase2/data/theta_shift.txt"));
907  desc.add<edm::FileInPath>("global_coords_filename",
908  edm::FileInPath("L1Trigger/DTTriggerPhase2/data/global_coord_perp_x_phi0.txt"));
909  desc.add<int>("algo", 0);
910  desc.add<int>("minHits4Fit", 3);
911  desc.add<bool>("splitPathPerSL", true);
912  desc.addUntracked<bool>("debug", false);
913  desc.addUntracked<bool>("dump", false);
914  desc.add<edm::InputTag>("rpcRecHits", edm::InputTag("rpcRecHits"));
915  desc.add<bool>("useRPC", false);
916  desc.add<int>("bx_window", 1);
917  desc.add<double>("phi_window", 50.0);
918  desc.add<int>("max_quality_to_overwrite_t0", 9);
919  desc.add<bool>("storeAllRPCHits", false);
920  desc.add<bool>("activateBuffer", false);
921  desc.add<double>("superCelltimewidth", 400);
922  desc.add<int>("superCellspacewidth", 20);
923  {
925  psd0.addUntracked<bool>("debug", false);
926  psd0.add<double>("angletan", 0.3);
927  psd0.add<double>("anglebinwidth", 1.0);
928  psd0.add<double>("posbinwidth", 2.1);
929  psd0.add<double>("maxdeltaAngDeg", 10);
930  psd0.add<double>("maxdeltaPos", 10);
931  psd0.add<int>("UpperNumber", 6);
932  psd0.add<int>("LowerNumber", 4);
933  psd0.add<double>("MaxDistanceToWire", 0.03);
934  psd0.add<int>("minNLayerHits", 6);
935  psd0.add<int>("minSingleSLHitsMax", 3);
936  psd0.add<int>("minSingleSLHitsMin", 3);
937  psd0.add<bool>("allowUncorrelatedPatterns", true);
938  psd0.add<int>("minUncorrelatedHits", 3);
939  desc.add<edm::ParameterSetDescription>("HoughGrouping", psd0);
940  }
941  {
943  psd0.add<edm::FileInPath>(
944  "pattern_filename", edm::FileInPath("L1Trigger/DTTriggerPhase2/data/PseudoBayesPatterns_uncorrelated_v0.root"));
945  psd0.addUntracked<bool>("debug", false);
946  psd0.add<int>("minNLayerHits", 3);
947  psd0.add<int>("minSingleSLHitsMax", 3);
948  psd0.add<int>("minSingleSLHitsMin", 0);
949  psd0.add<int>("allowedVariance", 1);
950  psd0.add<bool>("allowDuplicates", false);
951  psd0.add<bool>("setLateralities", true);
952  psd0.add<bool>("allowUncorrelatedPatterns", true);
953  psd0.add<int>("minUncorrelatedHits", 3);
954  psd0.add<bool>("saveOnPlace", true);
955  psd0.add<int>("maxPathsPerMatch", 256);
956  desc.add<edm::ParameterSetDescription>("PseudoBayesPattern", psd0);
957  }
958  descriptions.add("dtTriggerPhase2PrimitiveDigis", desc);
959 }
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 738 of file DTTrigPhase2Prod.cc.

References fileinputsource_cfi::sec.

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

◆ inner()

bool DTTrigPhase2Prod::inner ( const metaPrimitive mp) const

Definition at line 733 of file DTTrigPhase2Prod.cc.

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

Referenced by produce().

733  {
734  int counter = (mp.wi1 != -1) + (mp.wi2 != -1) + (mp.wi3 != -1) + (mp.wi4 != -1);
735  return (counter > 2);
736 }

◆ outer()

bool DTTrigPhase2Prod::outer ( const metaPrimitive mp) const

Definition at line 728 of file DTTrigPhase2Prod.cc.

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

728  {
729  int counter = (mp.wi5 != -1) + (mp.wi6 != -1) + (mp.wi7 != -1) + (mp.wi8 != -1);
730  return (counter > 2);
731 }

◆ printmP()

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

Definition at line 740 of file DTTrigPhase2Prod.cc.

References cmsdt::metaPrimitive::chi2, createfilelist::int, rango(), cmsdt::metaPrimitive::rawId, contentValuesCheck::ss, 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.

Referenced by produce().

740  {
741  DTSuperLayerId slId(mP.rawId);
742  LogInfo("DTTrigPhase2Prod") << ss << (int)slId << "\t " << setw(2) << left << mP.wi1 << " " << setw(2) << left
743  << mP.wi2 << " " << setw(2) << left << mP.wi3 << " " << setw(2) << left << mP.wi4 << " "
744  << setw(5) << left << mP.tdc1 << " " << setw(5) << left << mP.tdc2 << " " << setw(5)
745  << left << mP.tdc3 << " " << setw(5) << left << mP.tdc4 << " " << setw(10) << right
746  << mP.x << " " << setw(9) << left << mP.tanPhi << " " << setw(5) << left << mP.t0 << " "
747  << setw(13) << left << mP.chi2 << " r:" << rango(mP);
748 }
Log< level::Info, false > LogInfo
int rango(const metaPrimitive &mp) const

◆ printmPC()

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

Definition at line 750 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, contentValuesCheck::ss, 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.

Referenced by produce().

750  {
751  DTChamberId ChId(mP.rawId);
752  LogInfo("DTTrigPhase2Prod") << ss << (int)ChId << "\t " << setw(2) << left << mP.wi1 << " " << setw(2) << left
753  << mP.wi2 << " " << setw(2) << left << mP.wi3 << " " << setw(2) << left << mP.wi4 << " "
754  << setw(2) << left << mP.wi5 << " " << setw(2) << left << mP.wi6 << " " << setw(2) << left
755  << mP.wi7 << " " << setw(2) << left << mP.wi8 << " " << setw(5) << left << mP.tdc1 << " "
756  << setw(5) << left << mP.tdc2 << " " << setw(5) << left << mP.tdc3 << " " << setw(5)
757  << left << mP.tdc4 << " " << setw(5) << left << mP.tdc5 << " " << setw(5) << left
758  << mP.tdc6 << " " << setw(5) << left << mP.tdc7 << " " << setw(5) << left << mP.tdc8
759  << " " << setw(2) << left << mP.lat1 << " " << setw(2) << left << mP.lat2 << " "
760  << setw(2) << left << mP.lat3 << " " << setw(2) << left << mP.lat4 << " " << setw(2)
761  << left << mP.lat5 << " " << setw(2) << left << mP.lat6 << " " << setw(2) << left
762  << mP.lat7 << " " << setw(2) << left << mP.lat8 << " " << setw(10) << right << mP.x << " "
763  << setw(9) << left << mP.tanPhi << " " << setw(5) << left << mP.t0 << " " << setw(13)
764  << left << mP.chi2 << " r:" << rango(mP);
765 }
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 849 of file DTTrigPhase2Prod.cc.

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

Referenced by distribDigis().

850  {
851  bool classified = false;
852  if (!vec.empty()) {
853  for (auto& sC : vec) { // Conditions for entering a super cell.
854  if ((sC->front().second.time() + superCelltimewidth_) > inQ.front().second.time()) {
855  // Time requirement
856  if (TMath::Abs(sC->front().second.wire() - inQ.front().second.wire()) <= superCellhalfspacewidth_) {
857  // Spatial requirement
858  sC->push(std::move(inQ.front()));
859  classified = true;
860  }
861  }
862  }
863  }
864  if (classified) {
865  inQ.pop();
866  return;
867  }
868 
869  std::queue<std::pair<DTLayerId, DTDigi>> newQueue;
870 
871  std::pair<DTLayerId, DTDigi> tmpPair;
872  tmpPair = std::move(inQ.front());
873  newQueue.push(tmpPair);
874  inQ.pop();
875 
876  vec.push_back(&newQueue);
877 }
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 258 of file DTTrigPhase2Prod.cc.

References activateBuffer_, algo_, assignIndex(), DTSuperLayerId::chamberId(), DTGeometry::chambers(), cmsdt::CHI2RES_CONV, cmsdt::CHIGHQ, cscdqm::DATA, debug_, df_extended_, distribDigis(), dtDigisToken_, dtGeo_, dump_, grouping_obj_, mps_fire::i, DTChamber::id(), iEvent, inner(), createfilelist::int, cmsdt::KRES_CONV, cmsdt::LHC_CLK_FREQ, LogDebug, cmsdt::LOWLOWQ, SiStripPI::max, cmsdt::MC, eostools::move(), mpathanalyzer_, mpathassociator_, mpathhitsfilter_, mpathqualityenhancer_, mpathredundantfilter_, cmsdt::PHIBRES_CONV, cmsdt::PHIRES_CONV, printmP(), printmPC(), FastTimerService_cff::range, rpc_integrator_, rpcRecHits_cfi::rpcRecHits, rpcRecHitsLabel_, scenario_, DTChamberId::sector(), cmsdt::SLICE_TEST, jetUpdater_cfi::sort, contentValuesCheck::ss, cmsdt::Standard, DTChamberId::station(), DTSuperLayerId::superLayer(), DTLayerId::superlayerId(), useRPC_, DTChamberId::wheel(), and cmsdt::ZRES_CONV.

258  {
259  if (debug_)
260  LogDebug("DTTrigPhase2Prod") << "produce";
262  iEvent.getByToken(dtDigisToken_, dtdigis);
263 
264  if (debug_)
265  LogDebug("DTTrigPhase2Prod") << "\t Getting the RPC RecHits" << std::endl;
267  iEvent.getByToken(rpcRecHitsLabel_, rpcRecHits);
268 
270  // GROUPING CODE:
272 
273  DTDigiMap digiMap;
275  for (const auto& detUnitIt : *dtdigis) {
276  const DTLayerId& layId = detUnitIt.first;
277  const DTChamberId chambId = layId.superlayerId().chamberId();
278  const DTDigiCollection::Range& range = detUnitIt.second;
279  digiMap[chambId].put(range, layId);
280  }
281 
282  // generate a list muon paths for each event!!!
283  if (debug_ && activateBuffer_)
284  LogDebug("DTTrigPhase2Prod") << "produce - Getting and grouping digis per chamber using a buffer and super cells.";
285  else if (debug_)
286  LogDebug("DTTrigPhase2Prod") << "produce - Getting and grouping digis per chamber.";
287 
288  MuonPathPtrs muonpaths;
289  for (const auto& ich : dtGeo_->chambers()) {
290  // 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.
291  const DTChamber* chamb = ich;
292  DTChamberId chid = chamb->id();
293  DTDigiMap_iterator dmit = digiMap.find(chid);
294 
295  if (dmit == digiMap.end())
296  continue;
297 
298  if (activateBuffer_) { // Use buffering (per chamber) or not
299  // Import digis from the station
300  std::vector<std::pair<DTLayerId, DTDigi>> tmpvec;
301  tmpvec.clear();
302 
303  for (const auto& dtLayerIdIt : (*dmit).second) {
304  for (DTDigiCollection::const_iterator digiIt = (dtLayerIdIt.second).first;
305  digiIt != (dtLayerIdIt.second).second;
306  digiIt++) {
307  tmpvec.emplace_back(dtLayerIdIt.first, *digiIt);
308  }
309  }
310 
311  // Check to enhance CPU time usage
312  if (tmpvec.empty())
313  continue;
314 
315  // Order digis depending on TDC time and insert them into a queue (FIFO buffer). TODO: adapt for MC simulations.
316  std::sort(tmpvec.begin(), tmpvec.end(), DigiTimeOrdering);
317  std::queue<std::pair<DTLayerId, DTDigi>> timequeue;
318 
319  for (const auto& elem : tmpvec)
320  timequeue.emplace(elem);
321  tmpvec.clear();
322 
323  // Distribute the digis from the queue into supercells
324  std::vector<DTDigiCollection*> superCells;
325  superCells = distribDigis(timequeue);
326 
327  // Process each supercell & collect the resulting muonpaths (as the muonpaths std::vector is only enlarged each time
328  // the groupings access it, it's not needed to "collect" the final products).
329 
330  while (!superCells.empty()) {
331  grouping_obj_->run(iEvent, iEventSetup, *(superCells.back()), muonpaths);
332  superCells.pop_back();
333  }
334  } else {
335  grouping_obj_->run(iEvent, iEventSetup, (*dmit).second, muonpaths);
336  }
337  }
338  digiMap.clear();
339 
340  if (dump_) {
341  for (unsigned int i = 0; i < muonpaths.size(); i++) {
342  stringstream ss;
343  ss << iEvent.id().event() << " mpath " << i << ": ";
344  for (int lay = 0; lay < muonpaths.at(i)->nprimitives(); lay++)
345  ss << muonpaths.at(i)->primitive(lay)->channelId() << " ";
346  for (int lay = 0; lay < muonpaths.at(i)->nprimitives(); lay++)
347  ss << muonpaths.at(i)->primitive(lay)->tdcTimeStamp() << " ";
348  for (int lay = 0; lay < muonpaths.at(i)->nprimitives(); lay++)
349  ss << muonpaths.at(i)->primitive(lay)->laterality() << " ";
350  LogInfo("DTTrigPhase2Prod") << ss.str();
351  }
352  }
353 
354  // FILTER GROUPING
355  MuonPathPtrs filteredmuonpaths;
356  if (algo_ == Standard) {
357  mpathredundantfilter_->run(iEvent, iEventSetup, muonpaths, filteredmuonpaths);
358  } else {
359  mpathhitsfilter_->run(iEvent, iEventSetup, muonpaths, filteredmuonpaths);
360  }
361 
362  if (dump_) {
363  for (unsigned int i = 0; i < filteredmuonpaths.size(); i++) {
364  stringstream ss;
365  ss << iEvent.id().event() << " filt. mpath " << i << ": ";
366  for (int lay = 0; lay < filteredmuonpaths.at(i)->nprimitives(); lay++)
367  ss << filteredmuonpaths.at(i)->primitive(lay)->channelId() << " ";
368  for (int lay = 0; lay < filteredmuonpaths.at(i)->nprimitives(); lay++)
369  ss << filteredmuonpaths.at(i)->primitive(lay)->tdcTimeStamp() << " ";
370  LogInfo("DTTrigPhase2Prod") << ss.str();
371  }
372  }
373 
377 
378  if (debug_)
379  LogDebug("DTTrigPhase2Prod") << "MUON PATHS found: " << muonpaths.size() << " (" << filteredmuonpaths.size()
380  << ") in event " << iEvent.id().event();
381  if (debug_)
382  LogDebug("DTTrigPhase2Prod") << "filling NmetaPrimtives" << std::endl;
383  std::vector<metaPrimitive> metaPrimitives;
384  MuonPathPtrs outmpaths;
385  if (algo_ == Standard) {
386  if (debug_)
387  LogDebug("DTTrigPhase2Prod") << "Fitting 1SL ";
388  mpathanalyzer_->run(iEvent, iEventSetup, filteredmuonpaths, metaPrimitives);
389  } else {
390  // implementation for advanced (2SL) grouping, no filter required..
391  if (debug_)
392  LogDebug("DTTrigPhase2Prod") << "Fitting 2SL at once ";
393  mpathanalyzer_->run(iEvent, iEventSetup, muonpaths, outmpaths);
394  }
395 
396  if (dump_) {
397  for (unsigned int i = 0; i < outmpaths.size(); i++) {
398  LogInfo("DTTrigPhase2Prod") << iEvent.id().event() << " mp " << i << ": " << outmpaths.at(i)->bxTimeValue() << " "
399  << outmpaths.at(i)->horizPos() << " " << outmpaths.at(i)->tanPhi() << " "
400  << outmpaths.at(i)->phi() << " " << outmpaths.at(i)->phiB() << " "
401  << outmpaths.at(i)->quality() << " " << outmpaths.at(i)->chiSquare();
402  }
403  for (unsigned int i = 0; i < metaPrimitives.size(); i++) {
404  stringstream ss;
405  ss << iEvent.id().event() << " mp " << i << ": ";
406  printmP(ss.str(), metaPrimitives.at(i));
407  }
408  }
409 
410  muonpaths.clear();
411  filteredmuonpaths.clear();
412 
414  // FILTER SECTIONS:
416 
417  if (debug_)
418  LogDebug("DTTrigPhase2Prod") << "declaring new vector for filtered" << std::endl;
419 
420  std::vector<metaPrimitive> filteredMetaPrimitives;
421  if (algo_ == Standard)
422  mpathqualityenhancer_->run(iEvent, iEventSetup, metaPrimitives, filteredMetaPrimitives);
423 
424  if (dump_) {
425  for (unsigned int i = 0; i < filteredMetaPrimitives.size(); i++) {
426  stringstream ss;
427  ss << iEvent.id().event() << " filtered mp " << i << ": ";
428  printmP(ss.str(), filteredMetaPrimitives.at(i));
429  }
430  }
431 
432  metaPrimitives.clear();
433  metaPrimitives.erase(metaPrimitives.begin(), metaPrimitives.end());
434 
435  if (debug_)
436  LogDebug("DTTrigPhase2Prod") << "DTp2 in event:" << iEvent.id().event() << " we found "
437  << filteredMetaPrimitives.size() << " filteredMetaPrimitives (superlayer)"
438  << std::endl;
439  if (debug_)
440  LogDebug("DTTrigPhase2Prod") << "filteredMetaPrimitives: starting correlations" << std::endl;
441 
445 
446  std::vector<metaPrimitive> correlatedMetaPrimitives;
447  if (algo_ == Standard)
448  mpathassociator_->run(iEvent, iEventSetup, dtdigis, filteredMetaPrimitives, correlatedMetaPrimitives);
449  else {
450  for (const auto& muonpath : outmpaths) {
451  correlatedMetaPrimitives.emplace_back(muonpath->rawId(),
452  (double)muonpath->bxTimeValue(),
453  muonpath->horizPos(),
454  muonpath->tanPhi(),
455  muonpath->phi(),
456  muonpath->phiB(),
457  muonpath->phi_cmssw(),
458  muonpath->phiB_cmssw(),
459  muonpath->chiSquare(),
460  (int)muonpath->quality(),
461  muonpath->primitive(0)->channelId(),
462  muonpath->primitive(0)->tdcTimeStamp(),
463  muonpath->primitive(0)->laterality(),
464  muonpath->primitive(1)->channelId(),
465  muonpath->primitive(1)->tdcTimeStamp(),
466  muonpath->primitive(1)->laterality(),
467  muonpath->primitive(2)->channelId(),
468  muonpath->primitive(2)->tdcTimeStamp(),
469  muonpath->primitive(2)->laterality(),
470  muonpath->primitive(3)->channelId(),
471  muonpath->primitive(3)->tdcTimeStamp(),
472  muonpath->primitive(3)->laterality(),
473  muonpath->primitive(4)->channelId(),
474  muonpath->primitive(4)->tdcTimeStamp(),
475  muonpath->primitive(4)->laterality(),
476  muonpath->primitive(5)->channelId(),
477  muonpath->primitive(5)->tdcTimeStamp(),
478  muonpath->primitive(5)->laterality(),
479  muonpath->primitive(6)->channelId(),
480  muonpath->primitive(6)->tdcTimeStamp(),
481  muonpath->primitive(6)->laterality(),
482  muonpath->primitive(7)->channelId(),
483  muonpath->primitive(7)->tdcTimeStamp(),
484  muonpath->primitive(7)->laterality());
485  }
486  }
487  filteredMetaPrimitives.clear();
488 
489  if (debug_)
490  LogDebug("DTTrigPhase2Prod") << "DTp2 in event:" << iEvent.id().event() << " we found "
491  << correlatedMetaPrimitives.size() << " correlatedMetPrimitives (chamber)";
492 
493  if (dump_) {
494  LogInfo("DTTrigPhase2Prod") << "DTp2 in event:" << iEvent.id().event() << " we found "
495  << correlatedMetaPrimitives.size() << " correlatedMetPrimitives (chamber)";
496 
497  for (unsigned int i = 0; i < correlatedMetaPrimitives.size(); i++) {
498  stringstream ss;
499  ss << iEvent.id().event() << " correlated mp " << i << ": ";
500  printmPC(ss.str(), correlatedMetaPrimitives.at(i));
501  }
502  }
503 
504  double shift_back = 0;
505  if (scenario_ == MC) //scope for MC
506  shift_back = 400;
507  else if (scenario_ == DATA) //scope for data
508  shift_back = 0;
509  else if (scenario_ == SLICE_TEST) //scope for slice test
510  shift_back = 400;
511 
512  // RPC integration
513  if (useRPC_) {
514  rpc_integrator_->initialise(iEventSetup, shift_back);
515  rpc_integrator_->prepareMetaPrimitives(rpcRecHits);
516  rpc_integrator_->matchWithDTAndUseRPCTime(correlatedMetaPrimitives);
517  rpc_integrator_->makeRPCOnlySegments();
518  rpc_integrator_->storeRPCSingleHits();
519  rpc_integrator_->removeRPCHitsUsed();
520  }
521 
523  vector<L1Phase2MuDTPhDigi> outP2Ph;
524  vector<L1Phase2MuDTExtPhDigi> outExtP2Ph;
525  vector<L1Phase2MuDTThDigi> outP2Th;
526  vector<L1Phase2MuDTExtThDigi> outExtP2Th;
527 
528  // Assigning index value
529  assignIndex(correlatedMetaPrimitives);
530  for (const auto& metaPrimitiveIt : correlatedMetaPrimitives) {
531  DTChamberId chId(metaPrimitiveIt.rawId);
532  DTSuperLayerId slId(metaPrimitiveIt.rawId);
533  if (debug_)
534  LogDebug("DTTrigPhase2Prod") << "looping in final vector: SuperLayerId" << chId << " x=" << metaPrimitiveIt.x
535  << " quality=" << metaPrimitiveIt.quality
536  << " BX=" << round(metaPrimitiveIt.t0 / 25.) << " index=" << metaPrimitiveIt.index;
537 
538  int sectorTP = chId.sector();
539  //sectors 13 and 14 exist only for the outermost stations for sectors 4 and 10 respectively
540  //due to the larger MB4 that are divided into two.
541  if (sectorTP == 13)
542  sectorTP = 4;
543  if (sectorTP == 14)
544  sectorTP = 10;
545  sectorTP = sectorTP - 1;
546  int sl = 0;
547  if (metaPrimitiveIt.quality < LOWLOWQ || metaPrimitiveIt.quality == CHIGHQ) {
548  if (inner(metaPrimitiveIt))
549  sl = 1;
550  else
551  sl = 3;
552  }
553 
554  if (debug_)
555  LogDebug("DTTrigPhase2Prod") << "pushing back phase-2 dataformat carlo-federica dataformat";
556 
557  if (slId.superLayer() != 2) {
558  if (df_extended_ == 1 || df_extended_ == 2) {
559  int pathWireId[8] = {metaPrimitiveIt.wi1,
560  metaPrimitiveIt.wi2,
561  metaPrimitiveIt.wi3,
562  metaPrimitiveIt.wi4,
563  metaPrimitiveIt.wi5,
564  metaPrimitiveIt.wi6,
565  metaPrimitiveIt.wi7,
566  metaPrimitiveIt.wi8};
567 
568  int pathTDC[8] = {max((int)round(metaPrimitiveIt.tdc1 - shift_back * LHC_CLK_FREQ), -1),
569  max((int)round(metaPrimitiveIt.tdc2 - shift_back * LHC_CLK_FREQ), -1),
570  max((int)round(metaPrimitiveIt.tdc3 - shift_back * LHC_CLK_FREQ), -1),
571  max((int)round(metaPrimitiveIt.tdc4 - shift_back * LHC_CLK_FREQ), -1),
572  max((int)round(metaPrimitiveIt.tdc5 - shift_back * LHC_CLK_FREQ), -1),
573  max((int)round(metaPrimitiveIt.tdc6 - shift_back * LHC_CLK_FREQ), -1),
574  max((int)round(metaPrimitiveIt.tdc7 - shift_back * LHC_CLK_FREQ), -1),
575  max((int)round(metaPrimitiveIt.tdc8 - shift_back * LHC_CLK_FREQ), -1)};
576 
577  int pathLat[8] = {metaPrimitiveIt.lat1,
578  metaPrimitiveIt.lat2,
579  metaPrimitiveIt.lat3,
580  metaPrimitiveIt.lat4,
581  metaPrimitiveIt.lat5,
582  metaPrimitiveIt.lat6,
583  metaPrimitiveIt.lat7,
584  metaPrimitiveIt.lat8};
585 
586  // phiTP (extended DF)
587  outExtP2Ph.emplace_back(
588  L1Phase2MuDTExtPhDigi((int)round(metaPrimitiveIt.t0 / (float)LHC_CLK_FREQ) - shift_back,
589  chId.wheel(), // uwh (m_wheel)
590  sectorTP, // usc (m_sector)
591  chId.station(), // ust (m_station)
592  sl, // ust (m_station)
593  (int)round(metaPrimitiveIt.phi * PHIRES_CONV), // uphi (m_phiAngle)
594  (int)round(metaPrimitiveIt.phiB * PHIBRES_CONV), // uphib (m_phiBending)
595  metaPrimitiveIt.quality, // uqua (m_qualityCode)
596  metaPrimitiveIt.index, // uind (m_segmentIndex)
597  (int)round(metaPrimitiveIt.t0) - shift_back * LHC_CLK_FREQ, // ut0 (m_t0Segment)
598  (int)round(metaPrimitiveIt.chi2 * CHI2RES_CONV), // uchi2 (m_chi2Segment)
599  (int)round(metaPrimitiveIt.x * 1000), // ux (m_xLocal)
600  (int)round(metaPrimitiveIt.tanPhi * 1000), // utan (m_tanPsi)
601  (int)round(metaPrimitiveIt.phi_cmssw * PHIRES_CONV), // uphi (m_phiAngleCMSSW)
602  (int)round(metaPrimitiveIt.phiB_cmssw * PHIBRES_CONV), // uphib (m_phiBendingCMSSW)
603  metaPrimitiveIt.rpcFlag, // urpc (m_rpcFlag)
604  pathWireId,
605  pathTDC,
606  pathLat));
607  }
608  if (df_extended_ == 0 || df_extended_ == 2) {
609  // phiTP (standard DF)
610  outP2Ph.push_back(L1Phase2MuDTPhDigi(
611  (int)round(metaPrimitiveIt.t0 / (float)LHC_CLK_FREQ) - shift_back,
612  chId.wheel(), // uwh (m_wheel)
613  sectorTP, // usc (m_sector)
614  chId.station(), // ust (m_station)
615  sl, // ust (m_station)
616  (int)round(metaPrimitiveIt.phi * PHIRES_CONV), // uphi (_phiAngle)
617  (int)round(metaPrimitiveIt.phiB * PHIBRES_CONV), // uphib (m_phiBending)
618  metaPrimitiveIt.quality, // uqua (m_qualityCode)
619  metaPrimitiveIt.index, // uind (m_segmentIndex)
620  (int)round(metaPrimitiveIt.t0) - shift_back * LHC_CLK_FREQ, // ut0 (m_t0Segment)
621  (int)round(metaPrimitiveIt.chi2 * CHI2RES_CONV), // uchi2 (m_chi2Segment)
622  metaPrimitiveIt.rpcFlag // urpc (m_rpcFlag)
623  ));
624  }
625  } else {
626  if (df_extended_ == 1 || df_extended_ == 2) {
627  int pathWireId[4] = {metaPrimitiveIt.wi1, metaPrimitiveIt.wi2, metaPrimitiveIt.wi3, metaPrimitiveIt.wi4};
628 
629  int pathTDC[4] = {max((int)round(metaPrimitiveIt.tdc1 - shift_back * LHC_CLK_FREQ), -1),
630  max((int)round(metaPrimitiveIt.tdc2 - shift_back * LHC_CLK_FREQ), -1),
631  max((int)round(metaPrimitiveIt.tdc3 - shift_back * LHC_CLK_FREQ), -1),
632  max((int)round(metaPrimitiveIt.tdc4 - shift_back * LHC_CLK_FREQ), -1)};
633 
634  int pathLat[4] = {metaPrimitiveIt.lat1, metaPrimitiveIt.lat2, metaPrimitiveIt.lat3, metaPrimitiveIt.lat4};
635 
636  // thTP (extended DF)
637  outExtP2Th.emplace_back(
638  L1Phase2MuDTExtThDigi((int)round(metaPrimitiveIt.t0 / (float)LHC_CLK_FREQ) - shift_back,
639  chId.wheel(), // uwh (m_wheel)
640  sectorTP, // usc (m_sector)
641  chId.station(), // ust (m_station)
642  (int)round(metaPrimitiveIt.phi * ZRES_CONV), // uz (m_zGlobal)
643  (int)round(metaPrimitiveIt.phiB * KRES_CONV), // uk (m_kSlope)
644  metaPrimitiveIt.quality, // uqua (m_qualityCode)
645  metaPrimitiveIt.index, // uind (m_segmentIndex)
646  (int)round(metaPrimitiveIt.t0) - shift_back * LHC_CLK_FREQ, // ut0 (m_t0Segment)
647  (int)round(metaPrimitiveIt.chi2 * CHI2RES_CONV), // uchi2 (m_chi2Segment)
648  (int)round(metaPrimitiveIt.x * 1000), // ux (m_yLocal)
649  (int)round(metaPrimitiveIt.phi_cmssw * PHIRES_CONV), // uphi (m_zCMSSW)
650  (int)round(metaPrimitiveIt.phiB_cmssw * PHIBRES_CONV), // uphib (m_kCMSSW)
651  metaPrimitiveIt.rpcFlag, // urpc (m_rpcFlag)
652  pathWireId,
653  pathTDC,
654  pathLat));
655  }
656  if (df_extended_ == 0 || df_extended_ == 2) {
657  // thTP (standard DF)
658  outP2Th.push_back(L1Phase2MuDTThDigi(
659  (int)round(metaPrimitiveIt.t0 / (float)LHC_CLK_FREQ) - shift_back,
660  chId.wheel(), // uwh (m_wheel)
661  sectorTP, // usc (m_sector)
662  chId.station(), // ust (m_station)
663  (int)round(metaPrimitiveIt.phi * ZRES_CONV), // uz (m_zGlobal)
664  (int)round(metaPrimitiveIt.phiB * KRES_CONV), // uk (m_kSlope)
665  metaPrimitiveIt.quality, // uqua (m_qualityCode)
666  metaPrimitiveIt.index, // uind (m_segmentIndex)
667  (int)round(metaPrimitiveIt.t0) - shift_back * LHC_CLK_FREQ, // ut0 (m_t0Segment)
668  (int)round(metaPrimitiveIt.chi2 * CHI2RES_CONV), // uchi2 (m_chi2Segment)
669  metaPrimitiveIt.rpcFlag // urpc (m_rpcFlag)
670  ));
671  }
672  }
673  }
674 
675  // Storing RPC hits that were not used elsewhere
676  if (useRPC_) {
677  for (auto rpc_dt_digi = rpc_integrator_->rpcRecHits_translated_.begin();
678  rpc_dt_digi != rpc_integrator_->rpcRecHits_translated_.end();
679  rpc_dt_digi++) {
680  outP2Ph.push_back(*rpc_dt_digi);
681  }
682  }
683 
684  // Storing Phi results
685  if (df_extended_ == 1 || df_extended_ == 2) {
686  std::unique_ptr<L1Phase2MuDTExtPhContainer> resultExtP2Ph(new L1Phase2MuDTExtPhContainer);
687  resultExtP2Ph->setContainer(outExtP2Ph);
688  iEvent.put(std::move(resultExtP2Ph));
689  }
690  if (df_extended_ == 0 || df_extended_ == 2) {
691  std::unique_ptr<L1Phase2MuDTPhContainer> resultP2Ph(new L1Phase2MuDTPhContainer);
692  resultP2Ph->setContainer(outP2Ph);
693  iEvent.put(std::move(resultP2Ph));
694  }
695  outExtP2Ph.clear();
696  outExtP2Ph.erase(outExtP2Ph.begin(), outExtP2Ph.end());
697  outP2Ph.clear();
698  outP2Ph.erase(outP2Ph.begin(), outP2Ph.end());
699 
700  // Storing Theta results
701  if (df_extended_ == 1 || df_extended_ == 2) {
702  std::unique_ptr<L1Phase2MuDTExtThContainer> resultExtP2Th(new L1Phase2MuDTExtThContainer);
703  resultExtP2Th->setContainer(outExtP2Th);
704  iEvent.put(std::move(resultExtP2Th));
705  }
706  if (df_extended_ == 0 || df_extended_ == 2) {
707  std::unique_ptr<L1Phase2MuDTThContainer> resultP2Th(new L1Phase2MuDTThContainer);
708  resultP2Th->setContainer(outP2Th);
709  iEvent.put(std::move(resultP2Th));
710  }
711  outExtP2Th.clear();
712  outExtP2Th.erase(outExtP2Th.begin(), outExtP2Th.end());
713  outP2Th.clear();
714  outP2Th.erase(outP2Th.begin(), outP2Th.end());
715 }
std::unique_ptr< MotherGrouping > grouping_obj_
std::map< DTChamberId, DTDigiCollection, std::less< DTChamberId > > DTDigiMap
constexpr int CHI2RES_CONV
Definition: constants.h:226
constexpr float PHIBRES_CONV
Definition: constants.h:225
DTChamberId id() const
Return the DTChamberId of this chamber.
Definition: DTChamber.cc:32
std::vector< MuonPathPtr > MuonPathPtrs
Definition: MuonPath.h:128
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_
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitsLabel_
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:229
std::unique_ptr< MPFilter > mpathqualityenhancer_
void printmP(const std::string &ss, const metaPrimitive &mP) const
std::unique_ptr< MuonPathAssociator > mpathassociator_
constexpr float ZRES_CONV
Definition: constants.h:228
Log< level::Info, false > LogInfo
std::unique_ptr< MPFilter > mpathredundantfilter_
std::pair< const_iterator, const_iterator > Range
std::vector< DigiType >::const_iterator const_iterator
constexpr int LHC_CLK_FREQ
Definition: constants.h:176
DTDigiMap::iterator DTDigiMap_iterator
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:45
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
constexpr float PHIRES_CONV
Definition: constants.h:224
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

◆ rango()

int DTTrigPhase2Prod::rango ( const metaPrimitive mp) const

Definition at line 767 of file DTTrigPhase2Prod.cc.

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

Referenced by printmP(), and printmPC().

767  {
768  if (mp.quality == 1 or mp.quality == 2)
769  return 3;
770  if (mp.quality == 3 or mp.quality == 4)
771  return 4;
772  return mp.quality;
773 }
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 146 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ algo_

int DTTrigPhase2Prod::algo_
private

Definition at line 135 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ debug_

bool DTTrigPhase2Prod::debug_
private

Definition at line 123 of file DTTrigPhase2Prod.cc.

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

◆ df_extended_

int DTTrigPhase2Prod::df_extended_
private

Definition at line 127 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ dT0_correlate_TP_

double DTTrigPhase2Prod::dT0_correlate_TP_
private

Definition at line 125 of file DTTrigPhase2Prod.cc.

◆ dtDigisToken_

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

Definition at line 131 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ dtGeo_

const DTGeometry* DTTrigPhase2Prod::dtGeo_

Definition at line 111 of file DTTrigPhase2Prod.cc.

Referenced by beginRun(), and produce().

◆ dtGeomH

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

Definition at line 112 of file DTTrigPhase2Prod.cc.

Referenced by beginRun().

◆ dump_

bool DTTrigPhase2Prod::dump_
private

Definition at line 124 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ globalcoordsobtainer_

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

Definition at line 143 of file DTTrigPhase2Prod.cc.

◆ grouping_obj_

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

Definition at line 136 of file DTTrigPhase2Prod.cc.

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

◆ max_index_

int DTTrigPhase2Prod::max_index_
private

Definition at line 128 of file DTTrigPhase2Prod.cc.

Referenced by assignIndex().

◆ mpathanalyzer_

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

Definition at line 137 of file DTTrigPhase2Prod.cc.

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

◆ mpathassociator_

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

Definition at line 142 of file DTTrigPhase2Prod.cc.

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

◆ mpathhitsfilter_

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

Definition at line 141 of file DTTrigPhase2Prod.cc.

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

◆ mpathqualityenhancer_

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

Definition at line 138 of file DTTrigPhase2Prod.cc.

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

◆ mpathqualityenhancerbayes_

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

Definition at line 139 of file DTTrigPhase2Prod.cc.

Referenced by beginRun(), and endRun().

◆ mpathredundantfilter_

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

Definition at line 140 of file DTTrigPhase2Prod.cc.

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

◆ my_BXoffset_

int DTTrigPhase2Prod::my_BXoffset_
private

Definition at line 120 of file DTTrigPhase2Prod.cc.

◆ my_CCBValid_

bool DTTrigPhase2Prod::my_CCBValid_
private

Definition at line 117 of file DTTrigPhase2Prod.cc.

◆ primitives_

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

Definition at line 113 of file DTTrigPhase2Prod.cc.

◆ qmap_

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

Definition at line 161 of file DTTrigPhase2Prod.cc.

Referenced by assignQualityOrder().

◆ rpc_integrator_

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

Definition at line 154 of file DTTrigPhase2Prod.cc.

Referenced by endRun(), and produce().

◆ rpcRecHitsLabel_

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

Definition at line 132 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ scenario_

int DTTrigPhase2Prod::scenario_
private

Definition at line 126 of file DTTrigPhase2Prod.cc.

Referenced by produce().

◆ superCellhalfspacewidth_

int DTTrigPhase2Prod::superCellhalfspacewidth_
private

Definition at line 147 of file DTTrigPhase2Prod.cc.

Referenced by processDigi().

◆ superCelltimewidth_

float DTTrigPhase2Prod::superCelltimewidth_
private

Definition at line 148 of file DTTrigPhase2Prod.cc.

Referenced by processDigi().

◆ useRPC_

bool DTTrigPhase2Prod::useRPC_
private

Definition at line 155 of file DTTrigPhase2Prod.cc.

Referenced by produce().