50 DTThr(0), CSCThr(0), useAPE(
false)
54 propagator = theService.propagator(
"SmartPropagator");
56 theG = theService.trackingGeometry();
80 for ( std::vector<AlignTransformError>::const_iterator it = dtAlignmentErrors->m_alignError.begin();
81 it != dtAlignmentErrors->m_alignError.end(); it++ ) {
82 CLHEP::HepSymMatrix
error = (*it).matrix();
83 GlobalError glbErr(error[0][0], error[1][0], error[1][1], error[2][0], error[2][1], error[2][2]);
85 dtApeMap.insert( pair<DTChamberId, GlobalError> (DTid, glbErr) );
92 for ( std::vector<AlignTransformError>::const_iterator it = cscAlignmentErrors->m_alignError.begin();
93 it != cscAlignmentErrors->m_alignError.end(); it++ ) {
94 CLHEP::HepSymMatrix
error = (*it).matrix();
95 GlobalError glbErr(error[0][0], error[1][0], error[1][1], error[2][0], error[2][1], error[2][2]);
97 cscApeMap.insert( pair<CSCDetId, GlobalError> (CSCid, glbErr) );
101 std::vector<TrajectoryMeasurement> muonMeasurements = traj.
measurements();
103 for (std::vector<TrajectoryMeasurement>::const_iterator imT = muonMeasurements.begin(); imT != muonMeasurements.end(); imT++ ) {
104 if ( !(*imT).recHit()->isValid() )
continue;
107 result.push_back((*imT).recHit());
108 if (!(*imT).forwardPredictedState().isValid())
continue;
109 if ((*imT).forwardPredictedState().globalPosition().mag()
121 map<int, std::vector<DetId> > detMap;
133 if (useAPE_ == 1)
useAPE =
true;
135 if (bThr <= MAX_THR && bThr >= 0)
DTThr = bThr;
137 if (eThr <= MAX_THR && eThr >= 0)
CSCThr = eThr;
147 for (i=0; i<sz; i++) {
153 bestCSCSeg = segs[
i];
166 for (i=0; i<sz; i++) {
185 std::vector<const DetLayer *> navLayers;
187 for (
unsigned int ilayer=0; ilayer<navLayers.size(); ilayer++ ) {
191 std::vector<DetLayer::DetWithState> comps = navLayers[ilayer]->compatibleDets(
currentState,
195 if (comps.size() > 0) {
196 for (
unsigned int icomp=0; icomp<comps.size(); icomp++ ) {
197 DetId id(comps[icomp].
first->geographicalId().rawId());
198 detMap[ilayer].push_back(
id);
202 if (theEstimator)
delete theEstimator;
209 for (
unsigned int iDet = 0; iDet < detMap.size(); ++iDet) {
210 double bestLayerValue =
MAX_THR;
211 bool isDTorCSC =
false;
213 std::vector<DetId> chamber = detMap[iDet];
214 for (
unsigned int j = 0;
j < chamber.size(); ++
j) {
222 std::vector<DTRecSegment4D> allDTsegs;
223 std::map<int, std::vector<DTRecSegment4D> >::const_iterator dtIter = getSegs.
getDTlist().find(DTid.
station());
224 if (dtIter != getSegs.
getDTlist().end()){
225 allDTsegs = dtIter->second;
228 for (
unsigned int iSeg=0; iSeg<sz; ++iSeg) {
232 theG->idToDet(allDTsegs[iSeg].chamberId())->surface());
233 if (!tsosdt.
isValid())
continue;
235 std::vector<DTRecSegment4D> DTsegs;
236 DTsegs.push_back(allDTsegs[iSeg]);
239 double bestChamberValue =
getBest(DTsegs, tsosdt, bestDTSeg);
240 if (bestChamberValue < bestLayerValue) bestLayerValue = bestChamberValue;
243 if (bestChamberValue >=
DTThr || bestChamberValue > bestLayerValue)
continue;
244 layerRH.clear(); layerSEG.clear();
246 std::vector<DTRecHit1D> DTrh = getSegs.
getDTRHmap(bestDTSeg);
247 for (std::vector<DTRecHit1D>::iterator it = DTrh.begin(); it != DTrh.end(); it++) {
256 std::vector<CSCSegment> allCSCsegs;
257 std::map<int, std::vector<CSCSegment> >::const_iterator cscIter = getSegs.
getCSClist().find(CSCid.
station());
259 allCSCsegs = cscIter->second;
263 for (
unsigned int iSeg=0; iSeg<sz; ++iSeg) {
267 theG->idToDet(allCSCsegs[iSeg].cscDetId())->surface());
268 if (!tsoscsc.
isValid())
continue;
270 std::vector<CSCSegment> CSCsegs;
271 CSCsegs.push_back(allCSCsegs[iSeg]);
274 double bestChamberValue =
getBest(CSCsegs, tsoscsc, bestCSCSeg);
275 if (bestChamberValue < bestLayerValue) bestLayerValue = bestChamberValue;
278 if (bestChamberValue >=
CSCThr || bestChamberValue > bestLayerValue)
continue;
279 layerRH.clear(); layerSEG.clear();
281 std::vector<CSCRecHit2D> CSCrh = getSegs.
getCSCRHmap(bestCSCSeg);
282 for (std::vector<CSCRecHit2D>::iterator it = CSCrh.begin(); it != CSCrh.end(); ++it) {
295 if (layerSEG.size() > 0) {
296 result.push_back(layerSEG.front());
297 DetId id_ = layerSEG.front()->geographicalId();
345 for (ConstRecHitContainer::const_iterator it = recHits.begin(); it != recHits.end(); ++it) {
346 DTLayerId layid((*it)->det()->geographicalId());
355 for (ConstRecHitContainer::const_iterator it = recHits.begin(); it != recHits.end(); ++it) {
356 const CSCLayer* cscChamber =
cscGeom->layer((*it)->det()->geographicalId());
370 for(j=n-1; j>=
i; --
j)
372 if(recHits[j-1]->globalPosition().
mag() > recHits[j]->globalPosition().
mag())
374 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
FreeTrajectoryState * freeState(bool withErrors=true) const
const edm::EventSetup * theSetup
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
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