39 outputFileName_ ( cfg.getUntrackedParameter<std::
string>(
"histoutputFile") ),
40 PropagatorSource_ ( cfg.getParameter<std::
string>(
"propagator")),
41 muons_ ( cfg.getParameter<edm::InputTag>(
"muons" ) ),
42 muonsRemake_ ( cfg.getParameter<edm::InputTag>(
"muonsRemake" ) ),
43 muonsNoStation1_ ( cfg.getParameter<edm::InputTag>(
"muonsNoStation1") ),
44 muonsNoStation2_ ( cfg.getParameter<edm::InputTag>(
"muonsNoStation2") ),
45 muonsNoStation3_ ( cfg.getParameter<edm::InputTag>(
"muonsNoStation3") ),
46 muonsNoStation4_ ( cfg.getParameter<edm::InputTag>(
"muonsNoStation4") ),
64 debug_ ( cfg.getUntrackedParameter<bool>(
"doDebug" ) ),
83 if(
debug_) printf(
"STARTING EVENT\n");
100 event.getByLabel(
muons_ , muons );
179 if (
debug_) printf(
"Data Dump:: Rebuilt GMR Muon Track With TeV refitter default\n");
181 for ( reco::TrackCollection::const_iterator
muon = muonTracks->begin();
muon!=muonTracks->end();
muon++, iGmrRemake++) {
194 if (
debug_) printf(
"muons Remake");
195 if (
debug_) printf(
"-----------------------------------------\n");
200 printf(
"muons No Station 1");
201 printf(
"-----------------------------------------\n");
206 printf(
"muons No Station 2");
207 printf(
"-----------------------------------------\n");
212 printf(
"muons No Station 3");
213 printf(
"-----------------------------------------\n");
218 printf(
"muons No Station 4");
219 printf(
"-----------------------------------------\n");
237 for (reco::MuonCollection::const_iterator
muon = muons->begin();
muon != muons->end();
muon++, iGmrCyl++) {
251 if (iGmrRemake > 0 || iGmrCyl > 0) {
253 std::cout <<
"FILLING NTUPLE!" << std::endl;
255 }
else std::cout<<
"no tracks -- no fill!\n"<<std::endl<<std::endl;
288 for ( reco::TrackCollection::const_iterator
muon = trackColl->begin();
muon!=trackColl->end();
muon++) {
290 int iTrack =
muon - trackColl->begin();
298 int iRec = rec -
muon->recHitsBegin();
302 if (
debug_) printf(
"Rec Hit not from muon system or tracker... continuing...\n");
318 float gpRecX = gp.
x();
319 float gpRecY = gp.y();
320 float gpRecZ = gp.z();
321 float gpRecEta = gp.eta();
322 float gpRecPhi = gp.phi();
332 int superLayer = -999;
338 station =
id.station();
340 chamber =
id.chamber();
342 if (
debug_)printf(
"CSC\t[endcap][station][ringN][chamber][layer]:[%d][%d][%d][%d][%d]\t",
343 endcap, station, ring, chamber, layer);
350 superLayer =
id.superLayer();
352 sector =
id.sector();
353 if (
debug_) printf(
"DT \t[station][layer][superlayer]:[%d][%d][%d]\n", station,layer,superLayer);
359 if (
debug_) printf(
"RPC\t[station]:[%d]\n", station);
387 if (
debug_) printf(
"Tracker\n");
401 else printf(
"THIS CAN NOT HAPPEN\n");
403 trkExtrap(detid, numTracks, iTrack, iRec, recoStart, lp, trackExtrap);
406 if (
debug_) printf(
"\tLocal Positon: \tx = %2.2f\ty = %2.2f\tz = %2.2f\n",lpX, lpY, lpZ);
407 if (
debug_) printf(
"\tGlobal Position: \tx = %6.2f\ty = %6.2f\tz = %6.2f\teta = %4.2f\tphi = %3.2f\n",
408 gpRecX,gpRecY,gpRecZ,gpRecEta,gpRecPhi);
417 trackExtrap .
n_ = numTracks;
434 for ( reco::TrackCollection::const_iterator
muon = trackColl->begin();
muon!=trackColl->end();
muon++) {
436 int iTrack =
muon - trackColl->begin();
448 bool unbiasedRec =
true;
457 if (!unbiasedRec)
continue;
465 trkExtrap(detid, numTracks, iTrackLink, recCounter, recoStart, (*rec1)->localPosition(), trackExtrap);
472 trackExtrap.
n_ = numTracks;
481 if (
debug_) printf(
"Matching a re-fitted track to the original track.\n");
487 bool foundMatch =
false;
488 for (reco::TrackCollection::const_iterator refIt = ref->begin(); refIt!=ref->end(); refIt++) {
490 int iTrackMatch = refIt - ref->begin();
491 if (foundMatch && TrackMatch !=iTrackMatch)
break;
497 TrackMatch = iTrackMatch;
503 printf(
"SOMETHING WENT WRONG! Could not match Track with original track!");
508 if (
debug_) printf(
"Rec hit match for original track %d\n", TrackMatch);
549 double lpx1 = (*hit1)->localPosition().x();
550 double lpy1 = (*hit1)->localPosition().y();
551 double lpz1 = (*hit1)->localPosition().z();
553 double lpx2 = (*hit2)->localPosition().x();
554 double lpy2 = (*hit2)->localPosition().y();
555 double lpz2 = (*hit2)->localPosition().z();
556 if ( fabs( lpx1 - lpx2) > 1
e-3)
return false;
558 if ( fabs( lpy1 - lpy2) > 1
e-3)
return false;
560 if ( fabs( lpz1 - lpz2) > 1
e-3)
return false;
574 int subdetector = -1;
587 detector = detid.
det();
591 std::cout<<
"OMFG NOT THE TRACKER\n"<<std::endl;
601 <<
"\tlayer = " << layer
602 <<
"\tladder = " << ladder
603 <<
"\tmodule = " <<
module;
613 <<
"\tside = " << side
614 <<
"\tdisk = " << disk
615 <<
"\tblade = " << blade
616 <<
"\tpanel = " << panel
617 <<
"\tmodule = " <<
module;
624 <<
"\tlayer = " << layer
625 <<
"\tmodule = "<<
module;
632 <<
"\tside = " << side
633 <<
"\twheel = " << wheel
634 <<
"\tring = " <<
ring;
641 <<
"\tlayer = " << layer
642 <<
"\tmodule = " <<
module;
649 <<
"\tring = " << ring
650 <<
"\tmodule = "<<
module;
677 storeMuon.
pt_ [val] = muon->pt();
678 storeMuon.
p_ [val] = muon->p();
679 storeMuon.
eta_[val] = muon->eta();
680 storeMuon.
phi_[val] = muon->phi();
681 storeMuon.
charge_[val] = muon->charge();
682 storeMuon.
numRecHits_[val] = muon->numberOfValidHits();
683 storeMuon.
chiSq_[val] = muon->chi2();
684 storeMuon.
ndf_[val] = muon->ndof();
698 if (dump_)
std::cout<<
"In the trkExtrap function"<<std::endl;
700 float gpExtrapX = -99999;
701 float gpExtrapY = -99999;
702 float gpExtrapZ = -99999;
703 float gpExtrapEta = -99999;
704 float gpExtrapPhi = -99999;
714 float recLpX = recPoint.
x();
715 float recLpY = recPoint.
y();
716 float recLpZ = recPoint.
z();
730 gpExtrapX = globTest.
x();
731 gpExtrapY = globTest.
y();
732 gpExtrapZ = globTest.
z();
733 gpExtrapEta = globTest.
eta();
734 gpExtrapPhi = globTest.
phi();
750 storeTemp.
gpX_ [iTrk] = gpExtrapX ;
751 storeTemp.
gpY_ [iTrk] = gpExtrapY ;
752 storeTemp.
gpZ_ [iTrk] = gpExtrapZ ;
753 storeTemp.
gpEta_ [iTrk] = gpExtrapEta;
754 storeTemp.
gpPhi_ [iTrk] = gpExtrapPhi;
755 storeTemp.
lpX_ [iTrk] = lpX ;
756 storeTemp.
lpY_ [iTrk] = lpY ;
757 storeTemp.
lpZ_ [iTrk] = lpZ ;
758 storeTemp.
resX_ [iTrk] = resX ;
759 storeTemp.
resY_ [iTrk] = resY ;
760 storeTemp.
resZ_ [iTrk] = resZ ;
833 double phiVal = -9999;
834 double etaVal = -9999;
838 xVal = recoPoint.
x();
839 yVal = recoPoint.
y();
840 zVal = recoPoint.
z();
841 phiVal = recoPoint.
phi();
842 etaVal = recoPoint.
eta();
845 storage.
gpX_ [recNum] = xVal;
846 storage.
gpY_ [recNum] = yVal;
847 storage.
gpZ_ [recNum] = zVal;
848 storage.
gpEta_ [recNum] = etaVal;
849 storage.
gpPhi_ [recNum] = phiVal;
851 float rhoVal =
sqrt( xVal*xVal + yVal*yVal);
853 printf(
"Cylinder: rho = %4.2f\tphi = %4.2f\teta = %4.2f\n", rhoVal, phiVal, etaVal);
854 if (
debug_) printf(
"Cylinder: rho = %4.2f\tphi = %4.2f\teta = %4.2f\n", rhoVal, phiVal, etaVal);
866 if (
debug_) printf(
"zero_storage\n");
971 str->
pt_ [
i] = -9999;
972 str->
eta_ [
i] = -9999;
974 str->
phi_ [
i] = -9999;
977 str->
ndf_ [
i] = -9999;
992 str->
gpX_ [
i] = -9999;
993 str->
gpY_ [
i] = -9999;
994 str->
gpZ_ [
i] = -9999;
997 str->
lpX_ [
i] = -9999;
998 str->
lpY_ [
i] = -9999;
999 str->
lpZ_ [
i] = -9999;
1015 outputTree_ =
new TTree(
"outputTree",
"outputTree");
1074 "muonLink_[1000]/I:"
1082 "superLayer_[1000]/I:"
1102 "muonLink_[1000]/I:"
1103 "detector_[1000]/I:"
1104 "subdetector_[1000]/I:"
1166 "numRecHits_[10]/I:"
1169 "chiSqOvrNdf_[10]/F"
1181 "muonLink_[1000]/I:"
1217 <<
"\tx = " << innerPos.X()
1218 <<
"\ty = " << innerPos.Y()
1219 <<
"\tz = " << innerPos.Z()
1222 GlobalPoint innerPoint( innerPos.X(), innerPos.Y(), innerPos.Z());
1223 GlobalVector innerVec ( innerMom.X(), innerMom.Y(), innerMom.Z());
1239 for (
unsigned int i = 0;
i < (
unsigned int)track.
n_;
i++) {
1243 printf (
"%d\tmuonLink= %d",
i, (
int)track.
muonLink_[
i]);
1244 printf (
"\trecLink = %d", (
int)track.
recLink_[i] );
1251 printf (
"\t\tLocal\tx = %0.3f" , (
float)track.
lpX_[i] );
1252 printf (
"\ty = %0.3f" , (
float)track.
lpY_[i] );
1253 printf (
"\tz = %0.3f\n" , (
float)track.
lpZ_[i] );
1263 for (
unsigned int i = 0;
i < (
unsigned int)hit.
n_;
i++) {
1267 printf (
"%d\tsubdetector = %d\t superLayer =%d" ,
i, (
int)hit.
system_[
i], (
int)hit.
superLayer_[i] );
1274 printf (
"\t\tLocal\tx = %0.3f" , (
float)hit.
lpX_[i] );
1275 printf (
"\ty = %0.3f" , (
float)hit.
lpY_[i] );
1276 printf (
"\tz = %0.3f\n" , (
float)hit.
lpZ_[i] );
1286 for (
unsigned int i = 0;
i < (
unsigned int)hit.
n_;
i++) {
1291 printf (
"\tlayer = %d" , (
int)hit.
layer_[i] );
1298 printf (
"\t\tLocal\tx = %0.3f" , (
float)hit.
lpX_[i] );
1299 printf (
"\ty = %0.3f" , (
float)hit.
lpY_[i] );
1300 printf (
"\tz = %0.3f\n" , (
float)hit.
lpZ_[i] );
1310 float pt = muon->pt();
1311 float p = muon->p ();
1312 float eta = muon->eta();
1313 float phi = muon->phi();
1314 printf(
"\t%s: \tp = %4.2f \t pt = %4.2f \t eta = %4.2f \t phi = %4.2f\n",str.c_str(),
p,
pt,
eta,
phi);
void update(const edm::EventSetup &setup)
update the services each event
void CollectTrackHits(edm::Handle< reco::TrackCollection > trackColl, ResidualRefitting::storage_trackExtrap &trackExtrap, const edm::EventSetup &eventSetup)
int numRecHits_[N_MAX_STORED]
ResidualRefitting::storage_muon storageGmrNoTIBLayer4
int endcap_[N_MAX_STORED_HIT]
TkRotation< Scalar > RotationType
T getParameter(std::string const &) const
EventNumber_t event() const
ResidualRefitting::storage_muon storageTrkNoTOBLayer4
int ring_[N_MAX_STORED_HIT]
void zero_muon(ResidualRefitting::storage_muon *str)
static const int N_MAX_STORED
unsigned int tibLayer(const DetId &id) const
int muonLink_[N_MAX_STORED_HIT]
int ReturnStation(DetId detid)
unsigned int tidRing(const DetId &id) const
void dumpTrackRef(reco::TrackRef muon, std::string str)
ResidualRefitting::storage_muon storageGmrNoTOBLayer1
void dumpMuonRecHits(const ResidualRefitting::storage_hit &hit)
ResidualRefitting::storage_trackExtrap storageTrackNoTEC
ResidualRefitting::storage_muon storageGmrNoPXBLayer1
float lpZ_[N_MAX_STORED_HIT]
ResidualRefitting::storage_trackExtrap storageTrackNoPXBLayer1
int detector_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageGmrNoTID
ResidualRefitting::storage_muon storageTrkNoTOBLayer6
#define DEFINE_FWK_MODULE(type)
unsigned int pxfDisk(const DetId &id) const
LocalPoint localPosition() const
int ReturnSector(DetId detid)
ResidualRefitting::storage_muon storageGmrNoTIBLayer1
unsigned int tecRing(const DetId &id) const
ring id
ResidualRefitting::storage_trackHit storageTrackHit_
std::string PropagatorSource_
const MagneticField * theField
void zero_trackExtrap(ResidualRefitting::storage_trackExtrap *str)
Geom::Phi< T > phi() const
int disk_[N_MAX_STORED_HIT]
unsigned int pxbLadder(const DetId &id) const
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt3_
ResidualRefitting::storage_muon storageTrkNoTOBLayer5
GlobalPoint globalPosition() const
unsigned int tidWheel(const DetId &id) const
unsigned int pxbModule(const DetId &id) const
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer2
static const int N_MAX_STORED_HIT
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer4
int layer_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageTrkNoTIBLayer2
int sector_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageGmrNoTOBLayer2
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void NewTrackMeasurements(edm::Handle< reco::TrackCollection > trackCollOrig, edm::Handle< reco::TrackCollection > trackColl, ResidualRefitting::storage_trackExtrap &trackExtrap)
ResidualRefitting::storage_muon storageGmrNoSt1_
int layer_[N_MAX_STORED_HIT]
int chamber_[N_MAX_STORED_HIT]
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer6
float lpY_[N_MAX_STORED_HIT]
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt1_
void trkExtrap(const DetId &detid, int iTrkLink, int iTrk, int iRec, const FreeTrajectoryState &freeTrajState, const LocalPoint &recPoint, storage_trackExtrap &storeTemp)
ResidualRefitting::storage_muon storageGmrNoTOBLayer6
const Plane & surface() const
The nominal surface of the GeomDet.
int module_[N_MAX_STORED_HIT]
int muonLink_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageSamNew_
int charge_[N_MAX_STORED]
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer4
float gpEta_[N_MAX_STORED_HIT]
float gpPhi_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageTrkNoTID
ResidualRefitting::storage_trackExtrap storageTrackExtrapTracker_
float gpZ_[N_MAX_STORED_HIT]
ResidualRefitting::storage_trackExtrap storageTrackExtrapRec_
uint32_t rawId() const
get the raw id
Point3DBase< Scalar, GlobalTag > PositionType
ResidualRefitting::storage_muon storageGmrNoTOBLayer4
ResidualRefitting::storage_muon storageGmrNoSt4_
edm::InputTag muonsNoStation2_
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt4_
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer2
void branchMuon(ResidualRefitting::storage_muon &storageTmp, std::string branchName)
int MatchTrackWithRecHits(reco::TrackCollection::const_iterator trackIt, edm::Handle< reco::TrackCollection > ref)
unsigned int tidSide(const DetId &id) const
float lpX_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageSamNoSt4_
int wheel_[N_MAX_STORED_HIT]
void muonInfo(ResidualRefitting::storage_muon &storeMuon, reco::TrackRef muon, int val)
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt2_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
ResidualRefitting::storage_muon storageTrkNoPXBLayer2
edm::InputTag muonsNoStation1_
int subdetector_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageGmrNoSt2_
float gpY_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageGmrNoSt3_
float gpY_[N_MAX_STORED_HIT]
float lpX_[N_MAX_STORED_HIT]
MuonServiceProxy * theService
ResidualRefitting::storage_muon storageGmrNoPXBLayer2
void dumpTrackExtrap(const ResidualRefitting::storage_trackExtrap &track)
ResidualRefitting(const edm::ParameterSet &)
FreeTrajectoryState freeTrajStateMuon(reco::TrackRef muon)
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
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
ResidualRefitting::storage_muon storageGmrOld_
int side_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageTrkNoPXF
ResidualRefitting::storage_muon storageGmrNoTEC
ResidualRefitting::storage_trackExtrap trackExtrap120_
unsigned int tibModule(const DetId &id) const
unsigned int pxfModule(const DetId &id) const
unsigned int pxbLayer(const DetId &id) const
unsigned int tecModule(const DetId &id) const
edm::InputTag muonsNoStation3_
ResidualRefitting::storage_muon storageGmrNoTIBLayer3
ResidualRefitting::storage_muon storageGmrNew_
float gpX_[N_MAX_STORED_HIT]
std::string outputFileName_
int panel_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageGmrNoTIBLayer2
int station_[N_MAX_STORED_HIT]
edm::InputTag muonsRemake_
void cylExtrapTrkSam(int recNum, reco::TrackRef track, ResidualRefitting::storage_trackExtrap &storage, double rho)
float lpY_[N_MAX_STORED_HIT]
XYZVectorD XYZVector
spatial vector with cartesian internal representation
virtual GlobalPoint globalPosition() const GCC11_FINAL
XYZPointD XYZPoint
point in space with cartesian internal representation
float gpPhi_[N_MAX_STORED_HIT]
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
T const * product() const
ResidualRefitting::storage_muon storageTrkNoTIBLayer3
int ring_[N_MAX_STORED_HIT]
ResidualRefitting::storage_trackExtrap storageTrackNoTID
ResidualRefitting::storage_muon storageTrkNoTOBLayer2
unsigned int tobModule(const DetId &id) const
bool IsSameHit(trackingRecHit_iterator hit1, trackingRecHit_iterator hit2)
ResidualRefitting::storage_trackExtrap storageTrackNoPXBLayer3
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer5
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
get the tracking geometry
ResidualRefitting::storage_muon storageSamNoSt2_
void dumpTrackHits(const ResidualRefitting::storage_trackHit &hit)
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer3
int wheel_[N_MAX_STORED_HIT]
float lpZ_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageTrkNoTOBLayer1
float chiSqOvrNdf_[N_MAX_STORED]
ResidualRefitting::storage_muon storageGmrNoPXBLayer3
ResidualRefitting::storage_muon storageTrkNoTEC
ResidualRefitting::storage_muon storageSamNoSt3_
ResidualRefitting::storage_muon storageTrkNoPXBLayer1
float gpZ_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageTrkNoTIBLayer1
ResidualRefitting::storage_muon storageGmrNoTOBLayer3
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer1
unsigned int pxfSide(const DetId &id) const
int superLayer_[N_MAX_STORED_HIT]
ResidualRefitting::storage_event eventInfo_
ResidualRefitting::storage_hit storageRecMuon_
int blade_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageTrkNoTOBLayer3
edm::ESHandle< Propagator > thePropagator
float chiSq_[N_MAX_STORED]
void StoreTrackerRecHits(DetId detid, const TrackerTopology *tTopo, int iTrack, int iRec)
ResidualRefitting::storage_muon storageTrkNew_
ResidualRefitting::storage_trackExtrap storageTrackNoPXF
int station() const
Return the station number.
ResidualRefitting::storage_muon storageSamNoSt1_
Detector det() const
get the detector field from this detid
float gpEta_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageGmrNoTOBLayer5
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer3
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
edm::InputTag muonsNoStation4_
int system_[N_MAX_STORED_HIT]
unsigned int pxfPanel(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer1
int ladder_[N_MAX_STORED_HIT]
float gpX_[N_MAX_STORED_HIT]
void branchTrackExtrap(ResidualRefitting::storage_trackExtrap &storageTmp, std::string branchName)
ResidualRefitting::storage_muon storageGmrNoPXF
ResidualRefitting::storage_trackExtrap storageTrackNoPXBLayer2
unsigned int tobLayer(const DetId &id) const
ResidualRefitting::storage_muon storageTrkNoPXBLayer3
ResidualRefitting::storage_muon storageTrkNoTIBLayer4
ResidualRefitting::storage_trackExtrap samExtrap120_