48 DTThr(0), CSCThr(0), useAPE(
false)
52 propagator = theService.propagator(
"SmartPropagator");
54 theG = theService.trackingGeometry();
78 for ( std::vector<AlignTransformError>::const_iterator it = dtAlignmentErrors->m_alignError.begin();
79 it != dtAlignmentErrors->m_alignError.end(); it++ ) {
80 CLHEP::HepSymMatrix
error = (*it).matrix();
81 GlobalError glbErr(error[0][0], error[1][0], error[1][1], error[2][0], error[2][1], error[2][2]);
83 dtApeMap.insert( pair<DTChamberId, GlobalError> (DTid, glbErr) );
90 for ( std::vector<AlignTransformError>::const_iterator it = cscAlignmentErrors->m_alignError.begin();
91 it != cscAlignmentErrors->m_alignError.end(); it++ ) {
92 CLHEP::HepSymMatrix
error = (*it).matrix();
93 GlobalError glbErr(error[0][0], error[1][0], error[1][1], error[2][0], error[2][1], error[2][2]);
95 cscApeMap.insert( pair<CSCDetId, GlobalError> (CSCid, glbErr) );
99 std::vector<TrajectoryMeasurement> muonMeasurements = traj.
measurements();
101 for (std::vector<TrajectoryMeasurement>::const_iterator imT = muonMeasurements.begin(); imT != muonMeasurements.end(); imT++ ) {
102 if ( !(*imT).recHit()->isValid() )
continue;
105 result.push_back((*imT).recHit());
106 if (!(*imT).forwardPredictedState().isValid())
continue;
107 if ((*imT).forwardPredictedState().globalPosition().mag()
119 map<int, std::vector<DetId> > detMap;
131 if (useAPE_ == 1)
useAPE =
true;
133 if (bThr <= MAX_THR && bThr >= 0)
DTThr = bThr;
135 if (eThr <= MAX_THR && eThr >= 0)
CSCThr = eThr;
145 for (i=0; i<sz; i++) {
151 bestCSCSeg = segs[
i];
164 for (i=0; i<sz; i++) {
183 std::vector<const DetLayer *> navLayers;
185 for (
unsigned int ilayer=0; ilayer<navLayers.size(); ilayer++ ) {
189 std::vector<DetLayer::DetWithState> comps = navLayers[ilayer]->compatibleDets(
currentState,
193 if (comps.size() > 0) {
194 for (
unsigned int icomp=0; icomp<comps.size(); icomp++ ) {
195 DetId id(comps[icomp].
first->geographicalId().rawId());
196 detMap[ilayer].push_back(
id);
200 if (theEstimator)
delete theEstimator;
207 for (
unsigned int iDet = 0; iDet < detMap.size(); ++iDet) {
208 double bestLayerValue =
MAX_THR;
209 bool isDTorCSC =
false;
211 std::vector<DetId> chamber = detMap[iDet];
212 for (
unsigned int j = 0;
j < chamber.size(); ++
j) {
220 std::vector<DTRecSegment4D> allDTsegs;
221 std::map<int, std::vector<DTRecSegment4D> >::const_iterator dtIter = getSegs.
getDTlist().find(DTid.
station());
222 if (dtIter != getSegs.
getDTlist().end()){
223 allDTsegs = dtIter->second;
226 for (
unsigned int iSeg=0; iSeg<sz; ++iSeg) {
230 theG->idToDet(allDTsegs[iSeg].chamberId())->surface());
231 if (!tsosdt.
isValid())
continue;
233 std::vector<DTRecSegment4D> DTsegs;
234 DTsegs.push_back(allDTsegs[iSeg]);
237 double bestChamberValue =
getBest(DTsegs, tsosdt, bestDTSeg);
238 if (bestChamberValue < bestLayerValue) bestLayerValue = bestChamberValue;
241 if (bestChamberValue >=
DTThr || bestChamberValue > bestLayerValue)
continue;
242 layerRH.clear(); layerSEG.clear();
244 std::vector<DTRecHit1D> DTrh = getSegs.
getDTRHmap(bestDTSeg);
245 for (std::vector<DTRecHit1D>::iterator it = DTrh.begin(); it != DTrh.end(); it++) {
254 std::vector<CSCSegment> allCSCsegs;
255 std::map<int, std::vector<CSCSegment> >::const_iterator cscIter = getSegs.
getCSClist().find(CSCid.
station());
257 allCSCsegs = cscIter->second;
261 for (
unsigned int iSeg=0; iSeg<sz; ++iSeg) {
265 theG->idToDet(allCSCsegs[iSeg].cscDetId())->surface());
266 if (!tsoscsc.
isValid())
continue;
268 std::vector<CSCSegment> CSCsegs;
269 CSCsegs.push_back(allCSCsegs[iSeg]);
272 double bestChamberValue =
getBest(CSCsegs, tsoscsc, bestCSCSeg);
273 if (bestChamberValue < bestLayerValue) bestLayerValue = bestChamberValue;
276 if (bestChamberValue >=
CSCThr || bestChamberValue > bestLayerValue)
continue;
277 layerRH.clear(); layerSEG.clear();
279 std::vector<CSCRecHit2D> CSCrh = getSegs.
getCSCRHmap(bestCSCSeg);
280 for (std::vector<CSCRecHit2D>::iterator it = CSCrh.begin(); it != CSCrh.end(); ++it) {
293 if (layerSEG.size() > 0) {
294 result.push_back(layerSEG.front());
295 DetId id_ = layerSEG.front()->geographicalId();
343 for (ConstRecHitContainer::const_iterator it = recHits.begin(); it != recHits.end(); ++it) {
344 DTLayerId layid((*it)->det()->geographicalId());
353 for (ConstRecHitContainer::const_iterator it = recHits.begin(); it != recHits.end(); ++it) {
354 const CSCLayer* cscChamber =
cscGeom->layer((*it)->det()->geographicalId());
368 for(j=n-1; j>=
i; --
j)
370 if(recHits[j-1]->globalPosition().
mag() > recHits[j]->globalPosition().
mag())
372 swap (recHits[j-1],recHits[j]);
void swap(ora::Record &rh, ora::Record &lh)
DirectMuonNavigation * navigation
void compatibleDets(TrajectoryStateOnSurface &, std::map< int, std::vector< DetId > > &)
ConstRecHitPointer const & recHit() const
TrajectoryStateOnSurface currentState
edm::ESHandle< Propagator > propagatorCompatibleDet
std::vector< double > estimators
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
GlobalPoint globalPosition() const
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
U second(std::pair< T, U > const &p)
std::vector< CSCRecHit2D > getCSCRHmap(const CSCSegment &)
DataContainer const & measurements() const
void filteringAlgo(std::map< int, std::vector< DetId > > &)
edm::ESHandle< MuonDetLayerGeometry > navMuon
const std::map< int, std::vector< CSCSegment > > & getCSClist() const
ConstRecHitContainer result
const edm::EventSetup * theSetup
FreeTrajectoryState const * freeState(bool withErrors=true) const
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
double getBest(std::vector< CSCSegment > &, TrajectoryStateOnSurface &, CSCSegment &)
DetId geographicalId() const
The label of this GeomDet.
edm::ESHandle< TrajectoryStateUpdator > updatorHandle
TransientTrackingRecHit::ConstRecHitContainer filter(const Trajectory &)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
tuple Chi2MeasurementEstimator
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
const edm::Event * theEvent
edm::ESHandle< TransientTrackingRecHitBuilder > theMuonRecHitBuilder
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
std::vector< ConstRecHitPointer > ConstRecHitContainer
void setThr(int, int, int)
std::map< DTChamberId, GlobalError > dtApeMap
DynamicTruncation(const edm::Event &, const MuonServiceProxy &)
void update(TrajectoryStateOnSurface &, ConstRecHitPointer)
ConstRecHitContainer sort(ConstRecHitContainer &)
edm::ESHandle< Propagator > propagator
std::vector< std::vector< double > > tmp
const std::map< int, std::vector< DTRecSegment4D > > & getDTlist() const
void updateWithDThits(ConstRecHitContainer &)
void updateWithCSChits(ConstRecHitContainer &)
DetId geographicalId() const
volatile std::atomic< bool > shutdown_flag false
std::vector< DTRecHit1D > getDTRHmap(const DTRecSegment4D &)
int station() const
Return the station number.
Detector det() const
get the detector field from this detid
edm::ESHandle< MagneticField > magfield
std::map< CSCDetId, GlobalError > cscApeMap
edm::ESHandle< GlobalTrackingGeometry > theG
edm::ESHandle< CSCGeometry > cscGeom