44 outputFileName_ ( cfg.getUntrackedParameter<std::string>(
"histoutputFile") ),
45 PropagatorSource_ ( cfg.getParameter<std::string>(
"propagator")),
46 muons_ ( cfg.getParameter<edm::InputTag>(
"muons" ) ),
47 muonsRemake_ ( cfg.getParameter<edm::InputTag>(
"muonsRemake" ) ),
48 muonsNoStation1_ ( cfg.getParameter<edm::InputTag>(
"muonsNoStation1") ),
49 muonsNoStation2_ ( cfg.getParameter<edm::InputTag>(
"muonsNoStation2") ),
50 muonsNoStation3_ ( cfg.getParameter<edm::InputTag>(
"muonsNoStation3") ),
51 muonsNoStation4_ ( cfg.getParameter<edm::InputTag>(
"muonsNoStation4") ),
69 debug_ ( cfg.getUntrackedParameter<bool>(
"doDebug" ) ),
88 if(
debug_) printf(
"STARTING EVENT\n");
105 event.getByLabel(
muons_ , muons );
184 if (
debug_) printf(
"Data Dump:: Rebuilt GMR Muon Track With TeV refitter default\n");
186 for ( reco::TrackCollection::const_iterator
muon = muonTracks->begin();
muon!=muonTracks->end();
muon++, iGmrRemake++) {
199 if (
debug_) printf(
"muons Remake");
200 if (
debug_) printf(
"-----------------------------------------\n");
205 printf(
"muons No Station 1");
206 printf(
"-----------------------------------------\n");
211 printf(
"muons No Station 2");
212 printf(
"-----------------------------------------\n");
217 printf(
"muons No Station 3");
218 printf(
"-----------------------------------------\n");
223 printf(
"muons No Station 4");
224 printf(
"-----------------------------------------\n");
242 for (reco::MuonCollection::const_iterator
muon = muons->begin();
muon != muons->end();
muon++, iGmrCyl++) {
256 if (iGmrRemake > 0 || iGmrCyl > 0) {
258 std::cout <<
"FILLING NTUPLE!" << std::endl;
260 }
else std::cout<<
"no tracks -- no fill!\n"<<std::endl<<std::endl;
286 for ( reco::TrackCollection::const_iterator
muon = trackColl->begin();
muon!=trackColl->end();
muon++) {
288 int iTrack =
muon - trackColl->begin();
296 int iRec = rec -
muon->recHitsBegin();
300 if (
debug_) printf(
"Rec Hit not from muon system or tracker... continuing...\n");
316 float gpRecX = gp.x();
317 float gpRecY = gp.y();
318 float gpRecZ = gp.z();
319 float gpRecEta = gp.eta();
320 float gpRecPhi = gp.phi();
330 int superLayer = -999;
335 endcap =
id.endcap();
336 station =
id.station();
338 chamber =
id.chamber();
340 if (
debug_)printf(
"CSC\t[endcap][station][ringN][chamber][layer]:[%d][%d][%d][%d][%d]\t",
341 endcap, station, ring, chamber, layer);
346 station =
id.station();
348 superLayer =
id.superLayer();
350 sector =
id.sector();
351 if (
debug_) printf(
"DT \t[station][layer][superlayer]:[%d][%d][%d]\n", station,layer,superLayer);
356 station =
id.station();
357 if (
debug_) printf(
"RPC\t[station]:[%d]\n", station);
385 if (
debug_) printf(
"Tracker\n");
399 else printf(
"THIS CAN NOT HAPPEN\n");
401 trkExtrap(detid, numTracks, iTrack, iRec, recoStart, lp, trackExtrap);
404 if (
debug_) printf(
"\tLocal Positon: \tx = %2.2f\ty = %2.2f\tz = %2.2f\n",lpX, lpY, lpZ);
405 if (
debug_) printf(
"\tGlobal Position: \tx = %6.2f\ty = %6.2f\tz = %6.2f\teta = %4.2f\tphi = %3.2f\n",
406 gpRecX,gpRecY,gpRecZ,gpRecEta,gpRecPhi);
415 trackExtrap .
n_ = numTracks;
432 for ( reco::TrackCollection::const_iterator
muon = trackColl->begin();
muon!=trackColl->end();
muon++) {
434 int iTrack =
muon - trackColl->begin();
446 bool unbiasedRec =
true;
455 if (!unbiasedRec)
continue;
463 trkExtrap(detid, numTracks, iTrackLink, recCounter, recoStart, (*rec1)->localPosition(), trackExtrap);
470 trackExtrap.
n_ = numTracks;
479 if (
debug_) printf(
"Matching a re-fitted track to the original track.\n");
485 bool foundMatch =
false;
486 for (reco::TrackCollection::const_iterator refIt = ref->begin(); refIt!=ref->end(); refIt++) {
488 int iTrackMatch = refIt - ref->begin();
489 if (foundMatch && TrackMatch !=iTrackMatch)
break;
495 TrackMatch = iTrackMatch;
501 printf(
"SOMETHING WENT WRONG! Could not match Track with original track!");
506 if (
debug_) printf(
"Rec hit match for original track %d\n", TrackMatch);
547 double lpx1 = (*hit1)->localPosition().x();
548 double lpy1 = (*hit1)->localPosition().y();
549 double lpz1 = (*hit1)->localPosition().z();
551 double lpx2 = (*hit2)->localPosition().x();
552 double lpy2 = (*hit2)->localPosition().y();
553 double lpz2 = (*hit2)->localPosition().z();
554 if ( fabs( lpx1 - lpx2) > 1
e-3)
return false;
556 if ( fabs( lpy1 - lpy2) > 1
e-3)
return false;
558 if ( fabs( lpz1 - lpz2) > 1
e-3)
return false;
572 int subdetector = -1;
585 detector = detid.
det();
589 std::cout<<
"OMFG NOT THE TRACKER\n"<<std::endl;
597 ladder =
id.ladder();
598 module =
id.module();
600 <<
"\tlayer = " << layer
601 <<
"\tladder = " << ladder
602 <<
"\tmodule = " <<
module;
611 module =
id.module();
613 <<
"\tside = " << side
614 <<
"\tdisk = " << disk
615 <<
"\tblade = " << blade
616 <<
"\tpanel = " << panel
617 <<
"\tmodule = " <<
module;
623 module =
id.module();
625 <<
"\tlayer = " << layer
626 <<
"\tmodule = "<<
module;
634 <<
"\tside = " << side
635 <<
"\twheel = " << wheel
636 <<
"\tring = " <<
ring;
642 module =
id.module();
644 <<
"\tlayer = " << layer
645 <<
"\tmodule = " <<
module;
651 module =
id.module();
653 <<
"\tring = " << ring
654 <<
"\tmodule = "<<
module;
681 storeMuon.
pt_ [val] = muon->pt();
682 storeMuon.
p_ [val] = muon->p();
683 storeMuon.
eta_[val] = muon->eta();
684 storeMuon.
phi_[val] = muon->phi();
685 storeMuon.
charge_[val] = muon->charge();
686 storeMuon.
numRecHits_[val] = muon->numberOfValidHits();
687 storeMuon.
chiSq_[val] = muon->chi2();
688 storeMuon.
ndf_[val] = muon->ndof();
702 if (dump_)
std::cout<<
"In the trkExtrap function"<<std::endl;
704 float gpExtrapX = -99999;
705 float gpExtrapY = -99999;
706 float gpExtrapZ = -99999;
707 float gpExtrapEta = -99999;
708 float gpExtrapPhi = -99999;
718 float recLpX = recPoint.
x();
719 float recLpY = recPoint.
y();
720 float recLpZ = recPoint.
z();
734 gpExtrapX = globTest.
x();
735 gpExtrapY = globTest.
y();
736 gpExtrapZ = globTest.
z();
737 gpExtrapEta = globTest.
eta();
738 gpExtrapPhi = globTest.
phi();
754 storeTemp.
gpX_ [iTrk] = gpExtrapX ;
755 storeTemp.
gpY_ [iTrk] = gpExtrapY ;
756 storeTemp.
gpZ_ [iTrk] = gpExtrapZ ;
757 storeTemp.
gpEta_ [iTrk] = gpExtrapEta;
758 storeTemp.
gpPhi_ [iTrk] = gpExtrapPhi;
759 storeTemp.
lpX_ [iTrk] = lpX ;
760 storeTemp.
lpY_ [iTrk] = lpY ;
761 storeTemp.
lpZ_ [iTrk] = lpZ ;
762 storeTemp.
resX_ [iTrk] = resX ;
763 storeTemp.
resY_ [iTrk] = resY ;
764 storeTemp.
resZ_ [iTrk] = resZ ;
781 station =
id.station();
786 station =
id.station();
791 station =
id.station();
810 sector =
id.sector();
837 double phiVal = -9999;
838 double etaVal = -9999;
842 xVal = recoPoint.
x();
843 yVal = recoPoint.
y();
844 zVal = recoPoint.
z();
845 phiVal = recoPoint.
phi();
846 etaVal = recoPoint.
eta();
849 storage.
gpX_ [recNum] = xVal;
850 storage.
gpY_ [recNum] = yVal;
851 storage.
gpZ_ [recNum] = zVal;
852 storage.
gpEta_ [recNum] = etaVal;
853 storage.
gpPhi_ [recNum] = phiVal;
855 float rhoVal =
sqrt( xVal*xVal + yVal*yVal);
857 printf(
"Cylinder: rho = %4.2f\tphi = %4.2f\teta = %4.2f\n", rhoVal, phiVal, etaVal);
858 if (
debug_) printf(
"Cylinder: rho = %4.2f\tphi = %4.2f\teta = %4.2f\n", rhoVal, phiVal, etaVal);
870 if (
debug_) printf(
"zero_storage\n");
975 str->
pt_ [
i] = -9999;
976 str->
eta_ [
i] = -9999;
978 str->
phi_ [
i] = -9999;
981 str->
ndf_ [
i] = -9999;
996 str->
gpX_ [
i] = -9999;
997 str->
gpY_ [
i] = -9999;
998 str->
gpZ_ [
i] = -9999;
1001 str->
lpX_ [
i] = -9999;
1002 str->
lpY_ [
i] = -9999;
1003 str->
lpZ_ [
i] = -9999;
1019 outputTree_ =
new TTree(
"outputTree",
"outputTree");
1078 "muonLink_[1000]/I:"
1086 "superLayer_[1000]/I:"
1106 "muonLink_[1000]/I:"
1107 "detector_[1000]/I:"
1108 "subdetector_[1000]/I:"
1170 "numRecHits_[10]/I:"
1173 "chiSqOvrNdf_[10]/F"
1185 "muonLink_[1000]/I:"
1221 <<
"\tx = " << innerPos.X()
1222 <<
"\ty = " << innerPos.Y()
1223 <<
"\tz = " << innerPos.Z()
1226 GlobalPoint innerPoint( innerPos.X(), innerPos.Y(), innerPos.Z());
1227 GlobalVector innerVec ( innerMom.X(), innerMom.Y(), innerMom.Z());
1243 for (
unsigned int i = 0;
i < (
unsigned int)track.
n_;
i++) {
1247 printf (
"%d\tmuonLink= %d",
i, (
int)track.
muonLink_[
i]);
1248 printf (
"\trecLink = %d", (
int)track.
recLink_[i] );
1255 printf (
"\t\tLocal\tx = %0.3f" , (
float)track.
lpX_[i] );
1256 printf (
"\ty = %0.3f" , (
float)track.
lpY_[i] );
1257 printf (
"\tz = %0.3f\n" , (
float)track.
lpZ_[i] );
1267 for (
unsigned int i = 0;
i < (
unsigned int)hit.
n_;
i++) {
1271 printf (
"%d\tsubdetector = %d\t superLayer =%d" ,
i, (
int)hit.
system_[
i], (
int)hit.
superLayer_[i] );
1278 printf (
"\t\tLocal\tx = %0.3f" , (
float)hit.
lpX_[i] );
1279 printf (
"\ty = %0.3f" , (
float)hit.
lpY_[i] );
1280 printf (
"\tz = %0.3f\n" , (
float)hit.
lpZ_[i] );
1290 for (
unsigned int i = 0;
i < (
unsigned int)hit.
n_;
i++) {
1295 printf (
"\tlayer = %d" , (
int)hit.
layer_[i] );
1302 printf (
"\t\tLocal\tx = %0.3f" , (
float)hit.
lpX_[i] );
1303 printf (
"\ty = %0.3f" , (
float)hit.
lpY_[i] );
1304 printf (
"\tz = %0.3f\n" , (
float)hit.
lpZ_[i] );
1314 float pt = muon->pt();
1315 float p = muon->p ();
1316 float eta = muon->eta();
1317 float phi = muon->phi();
1318 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
int numRecHits_[N_MAX_STORED]
ResidualRefitting::storage_muon storageGmrNoTIBLayer4
int endcap_[N_MAX_STORED_HIT]
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
int muonLink_[N_MAX_STORED_HIT]
int ReturnStation(DetId detid)
void dumpTrackRef(reco::TrackRef muon, std::string str)
ResidualRefitting::storage_muon storageGmrNoTOBLayer1
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)
LocalPoint localPosition() const
int ReturnSector(DetId detid)
ResidualRefitting::storage_muon storageGmrNoTIBLayer1
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]
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt3_
ResidualRefitting::storage_muon storageTrkNoTOBLayer5
GlobalPoint globalPosition() 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
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
ResidualRefitting::storage_muon storageGmrNoTOBLayer4
void dumpTrackHits(ResidualRefitting::storage_trackHit hit)
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)
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
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_
void dumpMuonRecHits(ResidualRefitting::storage_hit hit)
int side_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageTrkNoPXF
ResidualRefitting::storage_muon storageGmrNoTEC
ResidualRefitting::storage_trackExtrap trackExtrap120_
edm::InputTag muonsNoStation3_
ResidualRefitting::storage_muon storageGmrNoTIBLayer3
void dumpTrackExtrap(ResidualRefitting::storage_trackExtrap track)
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
XYZPointD XYZPoint
point in space with cartesian internal representation
float gpPhi_[N_MAX_STORED_HIT]
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
ResidualRefitting::storage_muon storageTrkNoTIBLayer3
int ring_[N_MAX_STORED_HIT]
ResidualRefitting::storage_trackExtrap storageTrackNoTID
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, MediumProperties *mp=0)
void StoreTrackerRecHits(DetId detid, int iTrack, int iRec)
ResidualRefitting::storage_muon storageTrkNoTOBLayer2
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_
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]
const BoundPlane & surface() const
The nominal surface of the GeomDet.
ResidualRefitting::storage_muon storageGmrNoPXBLayer3
ResidualRefitting::storage_muon storageTrkNoTEC
ResidualRefitting::storage_muon storageSamNoSt3_
ResidualRefitting::storage_muon storageTrkNoPXBLayer1
float gpZ_[N_MAX_STORED_HIT]
void CollectTrackHits(edm::Handle< reco::TrackCollection > trackColl, ResidualRefitting::storage_trackExtrap &trackExtrap)
ResidualRefitting::storage_muon storageTrkNoTIBLayer1
ResidualRefitting::storage_muon storageGmrNoTOBLayer3
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer1
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]
ResidualRefitting::storage_muon storageTrkNew_
ResidualRefitting::storage_trackExtrap storageTrackNoPXF
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]
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
ResidualRefitting::storage_muon storageTrkNoPXBLayer3
ResidualRefitting::storage_muon storageTrkNoTIBLayer4
ResidualRefitting::storage_trackExtrap samExtrap120_