|
|
Go to the documentation of this file.
38 : outputFileName_(
cfg.getUntrackedParameter<
std::
string>(
"histoutputFile")),
39 PropagatorSource_(
cfg.getParameter<
std::
string>(
"propagator")),
42 muonsNoStation1_(
cfg.getParameter<
edm::
InputTag>(
"muonsNoStation1")),
43 muonsNoStation2_(
cfg.getParameter<
edm::
InputTag>(
"muonsNoStation2")),
44 muonsNoStation3_(
cfg.getParameter<
edm::
InputTag>(
"muonsNoStation3")),
45 muonsNoStation4_(
cfg.getParameter<
edm::
InputTag>(
"muonsNoStation4")),
63 debug_(
cfg.getUntrackedParameter<
bool>(
"doDebug")),
66 outputBranch_(nullptr),
81 printf(
"STARTING EVENT\n");
174 printf(
"Data Dump:: Rebuilt GMR Muon Track With TeV refitter default\n");
176 for (reco::TrackCollection::const_iterator
muon = muonTracks->begin();
muon != muonTracks->end();
177 muon++, iGmrRemake++) {
190 printf(
"muons Remake");
192 printf(
"-----------------------------------------\n");
196 printf(
"muons No Station 1");
197 printf(
"-----------------------------------------\n");
202 printf(
"muons No Station 2");
203 printf(
"-----------------------------------------\n");
208 printf(
"muons No Station 3");
209 printf(
"-----------------------------------------\n");
214 printf(
"muons No Station 4");
215 printf(
"-----------------------------------------\n");
230 for (reco::MuonCollection::const_iterator
muon =
muons->begin();
muon !=
muons->end();
muon++, iGmrCyl++) {
241 if (iGmrRemake > 0 || iGmrCyl > 0) {
243 std::cout <<
"FILLING NTUPLE!" << std::endl;
248 std::cout <<
"no tracks -- no fill!\n" << std::endl << std::endl;
289 for (
auto const& rec :
muon->recHits()) {
290 DetId detid = rec->geographicalId();
294 printf(
"Rec Hit not from muon system or tracker... continuing...\n");
309 float gpRecX =
gp.x();
310 float gpRecY =
gp.y();
311 float gpRecZ =
gp.z();
312 float gpRecEta =
gp.eta();
313 float gpRecPhi =
gp.phi();
322 int superLayer = -999;
333 printf(
"CSC\t[endcap][station][ringN][chamber][layer]:[%d][%d][%d][%d][%d]\t",
344 superLayer =
id.superLayer();
346 sector =
id.sector();
348 printf(
"DT \t[station][layer][superlayer]:[%d][%d][%d]\n",
station, layer, superLayer);
354 printf(
"RPC\t[station]:[%d]\n",
station);
394 printf(
"THIS CAN NOT HAPPEN\n");
396 trkExtrap(detid, numTracks, iTrack, iRec, recoStart, lp, trackExtrap);
400 printf(
"\tLocal Positon: \tx = %2.2f\ty = %2.2f\tz = %2.2f\n", lpX, lpY, lpZ);
402 printf(
"\tGlobal Position: \tx = %6.2f\ty = %6.2f\tz = %6.2f\teta = %4.2f\tphi = %3.2f\n",
415 trackExtrap.
n_ = numTracks;
440 for (
auto const& rec1 : ref->recHits()) {
441 bool unbiasedRec =
true;
443 for (
auto const& rec2 :
muon->recHits()) {
452 DetId detid = rec1->geographicalId();
457 trkExtrap(detid, numTracks, iTrackLink, recCounter, recoStart, rec1->localPosition(), trackExtrap);
462 trackExtrap.
n_ = numTracks;
470 printf(
"Matching a re-fitted track to the original track.\n");
474 for (
auto const& rec : trackIt->recHits()) {
475 bool foundMatch =
false;
476 for (reco::TrackCollection::const_iterator refIt = ref->begin(); refIt != ref->end(); refIt++) {
477 int iTrackMatch = refIt - ref->begin();
478 if (foundMatch && TrackMatch != iTrackMatch)
480 for (
auto const& recRef : refIt->recHits()) {
485 TrackMatch = iTrackMatch;
490 printf(
"SOMETHING WENT WRONG! Could not match Track with original track!");
495 printf(
"Rec hit match for original track %d\n", TrackMatch);
541 if (fabs(lpx1 - lpx2) > 1
e-3)
544 if (fabs(lpy1 - lpy2) > 1
e-3)
547 if (fabs(lpz1 - lpz2) > 1
e-3)
576 std::cout <<
"OMFG NOT THE TRACKER\n" << std::endl;
588 <<
"\tlayer = " << layer <<
"\tladder = " <<
ladder <<
"\tmodule = " <<
module;
598 <<
"\tside = " << side <<
"\tdisk = " << disk <<
"\tblade = " << blade <<
"\tpanel = " << panel
599 <<
"\tmodule = " <<
module;
606 <<
"\tlayer = " << layer <<
"\tmodule = " <<
module;
613 <<
"\tside = " << side <<
"\twheel = " <<
wheel <<
"\tring = " <<
ring;
620 <<
"\tlayer = " << layer <<
"\tmodule = " <<
module;
627 <<
"\tring = " <<
ring <<
"\tmodule = " <<
module;
673 std::cout <<
"In the trkExtrap function" << std::endl;
675 float gpExtrapX = -99999;
676 float gpExtrapY = -99999;
677 float gpExtrapZ = -99999;
678 float gpExtrapEta = -99999;
679 float gpExtrapPhi = -99999;
689 float recLpX = recPoint.
x();
690 float recLpY = recPoint.
y();
691 float recLpZ = recPoint.
z();
704 gpExtrapX = globTest.
x();
705 gpExtrapY = globTest.
y();
706 gpExtrapZ = globTest.
z();
707 gpExtrapEta = globTest.
eta();
708 gpExtrapPhi = globTest.
phi();
722 storeTemp.
gpX_[iTrk] = gpExtrapX;
723 storeTemp.
gpY_[iTrk] = gpExtrapY;
724 storeTemp.
gpZ_[iTrk] = gpExtrapZ;
725 storeTemp.
gpEta_[iTrk] = gpExtrapEta;
726 storeTemp.
gpPhi_[iTrk] = gpExtrapPhi;
727 storeTemp.
lpX_[iTrk] = lpX;
728 storeTemp.
lpY_[iTrk] = lpY;
729 storeTemp.
lpZ_[iTrk] = lpZ;
730 storeTemp.
resX_[iTrk] = resX;
731 storeTemp.
resY_[iTrk] = resY;
732 storeTemp.
resZ_[iTrk] = resZ;
770 sector =
id.sector();
797 double phiVal = -9999;
798 double etaVal = -9999;
802 xVal = recoPoint.
x();
803 yVal = recoPoint.
y();
804 zVal = recoPoint.
z();
805 phiVal = recoPoint.
phi();
806 etaVal = recoPoint.
eta();
809 storage.
gpX_[recNum] = xVal;
810 storage.
gpY_[recNum] = yVal;
811 storage.
gpZ_[recNum] = zVal;
812 storage.
gpEta_[recNum] = etaVal;
813 storage.
gpPhi_[recNum] = phiVal;
815 float rhoVal =
sqrt(xVal * xVal + yVal * yVal);
817 printf(
"Cylinder: rho = %4.2f\tphi = %4.2f\teta = %4.2f\n", rhoVal, phiVal, etaVal);
819 printf(
"Cylinder: rho = %4.2f\tphi = %4.2f\teta = %4.2f\n", rhoVal, phiVal, etaVal);
830 printf(
"zero_storage\n");
933 str->eta_[
i] = -9999;
935 str->phi_[
i] = -9999;
936 str->numRecHits_[
i] = -9999;
937 str->chiSq_[
i] = -9999;
938 str->ndf_[
i] = -9999;
939 str->chiSqOvrNdf_[
i] = -9999;
948 str->muonLink_[
i] = -9999;
949 str->recLink_[
i] = -9999;
950 str->gpX_[
i] = -9999;
951 str->gpY_[
i] = -9999;
952 str->gpZ_[
i] = -9999;
953 str->gpEta_[
i] = -9999;
954 str->gpPhi_[
i] = -9999;
955 str->lpX_[
i] = -9999;
956 str->lpY_[
i] = -9999;
957 str->lpZ_[
i] = -9999;
958 str->resX_[
i] = -9999;
959 str->resY_[
i] = -9999;
960 str->resZ_[
i] = -9999;
971 outputTree_ =
new TTree(
"outputTree",
"outputTree");
1030 "muonLink_[1000]/I:"
1038 "superLayer_[1000]/I:"
1056 "muonLink_[1000]/I:"
1057 "detector_[1000]/I:"
1058 "subdetector_[1000]/I:"
1117 "numRecHits_[10]/I:"
1120 "chiSqOvrNdf_[10]/F"
1131 "muonLink_[1000]/I:"
1163 <<
"\tx = " << innerPos.X() <<
"\ty = " << innerPos.Y() <<
"\tz = " << innerPos.Z() << std::endl;
1165 GlobalPoint innerPoint(innerPos.X(), innerPos.Y(), innerPos.Z());
1166 GlobalVector innerVec(innerMom.X(), innerMom.Y(), innerMom.Z());
1180 std::cout <<
"\n\nExtrapolation Dump:\n";
1181 for (
unsigned int i = 0;
i < (
unsigned int)
track.n_;
i++) {
1184 printf(
"%d\tmuonLink= %d",
i, (
int)
track.muonLink_[
i]);
1185 printf(
"\trecLink = %d", (
int)
track.recLink_[
i]);
1192 printf(
"\t\tLocal\tx = %0.3f", (
float)
track.lpX_[
i]);
1193 printf(
"\ty = %0.3f", (
float)
track.lpY_[
i]);
1194 printf(
"\tz = %0.3f\n", (
float)
track.lpZ_[
i]);
1202 for (
unsigned int i = 0;
i < (
unsigned int)
hit.n_;
i++) {
1205 printf(
"%d\tsubdetector = %d\t superLayer =%d",
i, (
int)
hit.system_[
i], (
int)
hit.superLayer_[
i]);
1212 printf(
"\t\tLocal\tx = %0.3f", (
float)
hit.lpX_[
i]);
1213 printf(
"\ty = %0.3f", (
float)
hit.lpY_[
i]);
1214 printf(
"\tz = %0.3f\n", (
float)
hit.lpZ_[
i]);
1221 std::cout <<
"Tracker Rec Hits Dump:\n";
1222 for (
unsigned int i = 0;
i < (
unsigned int)
hit.n_;
i++) {
1225 printf(
"%d\tsubdetector = %d",
i, (
int)
hit.subdetector_[
i]);
1226 printf(
"\tlayer = %d", (
int)
hit.layer_[
i]);
1233 printf(
"\t\tLocal\tx = %0.3f", (
float)
hit.lpX_[
i]);
1234 printf(
"\ty = %0.3f", (
float)
hit.lpY_[
i]);
1235 printf(
"\tz = %0.3f\n", (
float)
hit.lpZ_[
i]);
1243 float p =
muon->p();
1246 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);
ResidualRefitting::storage_muon storageGmrNoPXF
T const * product() const
ResidualRefitting::storage_muon storageTrkNoPXBLayer3
ResidualRefitting::storage_muon storageGmrNoTIBLayer1
void StoreTrackerRecHits(DetId detid, const TrackerTopology *tTopo, int iTrack, int iRec)
int disk_[N_MAX_STORED_HIT]
void dumpTrackRef(reco::TrackRef muon, std::string str)
int station_[N_MAX_STORED_HIT]
void dumpMuonRecHits(const ResidualRefitting::storage_hit &hit)
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
ResidualRefitting::storage_muon storageGmrNoPXBLayer1
ResidualRefitting::storage_muon storageGmrNoTOBLayer5
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer3
ResidualRefitting::storage_muon storageTrkNoTOBLayer4
unsigned int pxfSide(const DetId &id) const
ResidualRefitting::storage_muon storageTrkNoTOBLayer6
int panel_[N_MAX_STORED_HIT]
int system_[N_MAX_STORED_HIT]
const MagneticField * theField
float lpY_[N_MAX_STORED_HIT]
void zero_trackExtrap(ResidualRefitting::storage_trackExtrap *str)
int side_[N_MAX_STORED_HIT]
void CollectTrackHits(edm::Handle< reco::TrackCollection > trackColl, ResidualRefitting::storage_trackExtrap &trackExtrap, const edm::EventSetup &eventSetup)
int ReturnStation(DetId detid)
constexpr Detector det() const
get the detector field from this detid
ResidualRefitting::storage_muon storageGmrNoTOBLayer1
unsigned int pxbLadder(const DetId &id) const
GlobalPoint globalPosition() const
ResidualRefitting::storage_trackExtrap storageTrackNoTEC
float gpY_[N_MAX_STORED_HIT]
int numRecHits_[N_MAX_STORED]
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer4
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer4
int chamber_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageTrkNoTID
void zero_muon(ResidualRefitting::storage_muon *str)
ResidualRefitting::storage_trackExtrap storageTrackExtrapTracker_
ResidualRefitting::storage_muon storageTrkNoTIBLayer2
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
ResidualRefitting::storage_trackExtrap storageTrackExtrapRec_
int superLayer_[N_MAX_STORED_HIT]
int ReturnSector(DetId detid)
static const int N_MAX_STORED
std::string PropagatorSource_
ResidualRefitting::storage_muon storageGmrNoSt1_
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer6
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt1_
int ring_[N_MAX_STORED_HIT]
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt3_
virtual LocalPoint localPosition() const =0
ResidualRefitting::storage_trackExtrap storageTrackNoPXBLayer1
float gpX_[N_MAX_STORED_HIT]
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer2
unsigned int tidRing(const DetId &id) const
float gpZ_[N_MAX_STORED_HIT]
unsigned int tidWheel(const DetId &id) const
ResidualRefitting::storage_muon storageGmrNoTID
unsigned int pxbLayer(const DetId &id) const
ResidualRefitting::storage_muon storageGmrNoTOBLayer4
unsigned int pxfPanel(const DetId &id) const
int wheel_[N_MAX_STORED_HIT]
ResidualRefitting::storage_trackHit storageTrackHit_
edm::InputTag muonsNoStation2_
const Plane & surface() const
The nominal surface of the GeomDet.
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer2
ResidualRefitting::storage_muon storageGmrNoTOBLayer6
ResidualRefitting::storage_muon storageGmrNoSt3_
void trkExtrap(const DetId &detid, int iTrkLink, int iTrk, int iRec, const FreeTrajectoryState &freeTrajState, const LocalPoint &recPoint, storage_trackExtrap &storeTemp)
void analyze(const edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
ResidualRefitting::storage_muon storageTrkNoTOBLayer5
ResidualRefitting::storage_muon storageSamNoSt4_
float chiSq_[N_MAX_STORED]
static const int N_MAX_STORED_HIT
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt2_
ResidualRefitting::storage_muon storageGmrNoTOBLayer2
int muonLink_[N_MAX_STORED_HIT]
float lpZ_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageTrkNoPXF
edm::InputTag muonsNoStation1_
ResidualRefitting::storage_muon storageGmrNoSt4_
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt4_
ResidualRefitting::storage_muon storageGmrNoTEC
void NewTrackMeasurements(edm::Handle< reco::TrackCollection > trackCollOrig, edm::Handle< reco::TrackCollection > trackColl, ResidualRefitting::storage_trackExtrap &trackExtrap)
float chiSqOvrNdf_[N_MAX_STORED]
void branchMuon(ResidualRefitting::storage_muon &storageTmp, std::string branchName)
int MatchTrackWithRecHits(reco::TrackCollection::const_iterator trackIt, edm::Handle< reco::TrackCollection > ref)
ResidualRefitting::storage_muon storageSamNew_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
void dumpTrackExtrap(const ResidualRefitting::storage_trackExtrap &track)
float lpZ_[N_MAX_STORED_HIT]
float gpPhi_[N_MAX_STORED_HIT]
void update(const edm::EventSetup &setup, bool duringEvent=true)
update the services each event
std::string outputFileName_
edm::InputTag muonsRemake_
int wheel_[N_MAX_STORED_HIT]
LocalPoint localPosition() const
float gpEta_[N_MAX_STORED_HIT]
int endcap_[N_MAX_STORED_HIT]
XYZPointD XYZPoint
point in space with cartesian internal representation
float gpEta_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageGmrNoSt2_
int ring_[N_MAX_STORED_HIT]
edm::InputTag muonsNoStation3_
void muonInfo(ResidualRefitting::storage_muon &storeMuon, reco::TrackRef muon, int val)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
float gpY_[N_MAX_STORED_HIT]
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
unsigned int tibModule(const DetId &id) const
unsigned int tidSide(const DetId &id) const
ResidualRefitting(const edm::ParameterSet &)
unsigned int tecRing(const DetId &id) const
ring id
ResidualRefitting::storage_muon storageGmrOld_
unsigned int pxfModule(const DetId &id) const
~ResidualRefitting() override
unsigned int pxfDisk(const DetId &id) const
ResidualRefitting::storage_muon storageTrkNoPXBLayer2
ResidualRefitting::storage_muon storageTrkNoTOBLayer1
ResidualRefitting::storage_muon storageTrkNoTEC
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
ResidualRefitting::storage_muon storageGmrNoTOBLayer3
int layer_[N_MAX_STORED_HIT]
MuonServiceProxy * theService
ResidualRefitting::storage_muon storageGmrNoTIBLayer3
ResidualRefitting::storage_muon storageGmrNoPXBLayer2
int blade_[N_MAX_STORED_HIT]
int ladder_[N_MAX_STORED_HIT]
FreeTrajectoryState freeTrajStateMuon(reco::TrackRef muon)
ResidualRefitting::storage_muon storageGmrNoTIBLayer2
int sector_[N_MAX_STORED_HIT]
unsigned int tobLayer(const DetId &id) const
ResidualRefitting::storage_muon storageTrkNew_
constexpr uint32_t rawId() const
get the raw id
ResidualRefitting::storage_trackExtrap trackExtrap120_
ResidualRefitting::storage_muon storageGmrNoPXBLayer3
int module_[N_MAX_STORED_HIT]
unsigned int tobModule(const DetId &id) const
unsigned int pxbModule(const DetId &id) const
ResidualRefitting::storage_muon storageTrkNoPXBLayer1
ResidualRefitting::storage_trackExtrap storageTrackNoTID
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
get the tracking geometry
ResidualRefitting::storage_event eventInfo_
ResidualRefitting::storage_muon storageTrkNoTOBLayer2
const GeomDet * idToDet(DetId) const override
ResidualRefitting::storage_hit storageRecMuon_
float gpX_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageGmrNew_
ResidualRefitting::storage_trackExtrap storageTrackNoPXBLayer2
void dumpTrackHits(const ResidualRefitting::storage_trackHit &hit)
edm::ESHandle< Propagator > thePropagator
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer3
void cylExtrapTrkSam(int recNum, reco::TrackRef track, ResidualRefitting::storage_trackExtrap &storage, double rho)
ResidualRefitting::storage_muon storageTrkNoTIBLayer4
int muonLink_[N_MAX_STORED_HIT]
unsigned int tecModule(const DetId &id) const
ResidualRefitting::storage_muon storageSamNoSt3_
int charge_[N_MAX_STORED]
unsigned int pxfBlade(const DetId &id) const
ResidualRefitting::storage_muon storageTrkNoTIBLayer3
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer1
float gpPhi_[N_MAX_STORED_HIT]
float lpX_[N_MAX_STORED_HIT]
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer1
ResidualRefitting::storage_trackExtrap storageTrackNoPXBLayer3
void branchTrackExtrap(ResidualRefitting::storage_trackExtrap &storageTmp, std::string branchName)
ResidualRefitting::storage_muon storageSamNoSt2_
int layer_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageTrkNoTOBLayer3
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer5
float lpY_[N_MAX_STORED_HIT]
ResidualRefitting::storage_trackExtrap samExtrap120_
ResidualRefitting::storage_trackExtrap storageTrackNoPXF
ResidualRefitting::storage_muon storageSamNoSt1_
ResidualRefitting::storage_muon storageGmrNoTIBLayer4
Geom::Phi< T > phi() const
float lpX_[N_MAX_STORED_HIT]
int subdetector_[N_MAX_STORED_HIT]
bool IsSameHit(TrackingRecHit const &hit1, TrackingRecHit const &hit2)
int detector_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageTrkNoTIBLayer1
edm::InputTag muonsNoStation4_
unsigned int tibLayer(const DetId &id) const
float gpZ_[N_MAX_STORED_HIT]