80 void fill_x_1d(
double residx,
double chi2,
int dof);
81 void fill_x(
char charge,
double abscissa,
double residx,
double chi2,
int dof);
82 void fill_y(
char charge,
double abscissa,
double residy,
double chi2,
int dof);
83 void fill_dxdz(
char charge,
double abscissa,
double slopex,
double chi2,
int dof);
84 void fill_dydz(
char charge,
double abscissa,
double slopey,
double chi2,
int dof);
115 t =
id.iChamberType();
142 , m_muonCollectionTag(cfg.getParameter<edm::InputTag>(
"muonCollectionTag"))
143 , m_minTrackPt(cfg.getParameter<double>(
"minTrackPt"))
144 , m_maxTrackPt(cfg.getParameter<double>(
"maxTrackPt"))
145 , m_minTrackP(cfg.getParameter<double>(
"minTrackP"))
146 , m_maxTrackP(cfg.getParameter<double>(
"maxTrackP"))
147 , m_maxDxy(cfg.getParameter<double>(
"maxDxy"))
148 , m_minTrackerHits(cfg.getParameter<int>(
"minTrackerHits"))
149 , m_maxTrackerRedChi2(cfg.getParameter<double>(
"maxTrackerRedChi2"))
150 , m_allowTIDTEC(cfg.getParameter<bool>(
"allowTIDTEC"))
151 , m_minNCrossedChambers(cfg.getParameter<int>(
"minNCrossedChambers"))
152 , m_minDT13Hits(cfg.getParameter<int>(
"minDT13Hits"))
153 , m_minDT2Hits(cfg.getParameter<int>(
"minDT2Hits"))
154 , m_minCSCHits(cfg.getParameter<int>(
"minCSCHits"))
155 , m_doDT(cfg.getParameter<bool>(
"doDT"))
156 , m_doCSC(cfg.getParameter<bool>(
"doCSC"))
157 , m_useStubPosition(cfg.getParameter<bool>(
"useStubPosition"))
158 , m_createNtuple(cfg.getParameter<bool>(
"createNtuple"))
163 m_cscnt = fs->
make<TTree>(
"mualNtuple",
"mualNtuple");
174 assert(num>=0 && num <100);
176 sprintf(tmp,
"%02d", num);
188 sprintf(c_station,
"%d",
station);
195 if (
m_doDT)
for (
int sector = 1; sector <= 14; sector++)
205 if (
m_doDT)
for (
int wheel = -2; wheel <= 2; wheel++)
216 if (
endcap == 1) s_endcap =
"p";
218 for (
int chamber = 1; chamber <= 36; chamber++)
228 sprintf(c_ring,
"%d",
ring);
265 for (ConstTrajTrackPairCollection::const_iterator trajtrack = trajtracks.begin(); trajtrack != trajtracks.end(); ++trajtrack)
274 if ( fabs(track->
dxy(beamSpot->position())) <
m_maxDxy )
289 for (reco::MuonCollection::const_iterator
muon = muons->begin();
muon != muons->end(); ++
muon)
291 if ( !(
muon->isTrackerMuon() &&
muon->innerTrack().isNonnull() ) )
continue;
298 if (fabs(
muon->innerTrack()->dxy(beamSpot->position())) <
m_maxDxy)
318 std::vector<DetId> chamberIds = mrft.
chamberIds();
319 for (
unsigned ch=0; ch < chamberIds.size(); ch++)
if (chamberIds[ch].det() ==
DetId::Muon) nMuChambers++;
328 for (std::vector<DetId>::const_iterator chamberId = chamberIds.begin(); chamberId != chamberIds.end(); ++chamberId)
346 double chi2 = dt13->
chi2();
347 int dof = dt13->
ndof();
352 double phi = atan2(gpos.
y(), gpos.
x());
355 assert(1 <=
id.sector() &&
id.sector() <= 14);
371 phi = atan2(gpos.
y(), gpos.
x());
374 assert(1 <=
id.sector() &&
id.sector() <= 14);
388 double chi2 = dt13->
chi2();
389 int dof = dt13->
ndof();
394 double phi = atan2(gpos.
y(), gpos.
x());
397 assert(1 <=
id.sector() &&
id.sector() <= 14);
411 int ring =
id.ring();
412 if (
id.
ring()==4) ring = 1;
422 double chi2 = csc->
chi2();
423 int dof = csc->
ndof();
428 double phi = atan2(gpos.
y(), gpos.
x());
430 if (phi<-
M_PI/180.*5.) phi += 2.*
M_PI;
433 int chamber =
id.chamber() - 1;
434 if (
id.
station() > 1 && ring == 1) chamber *= 2;
436 assert(1 <=
id.
endcap() &&
id.
endcap() <= 2 && 0 <= chamber && chamber <= 35);
440 m_CSCvsr_me[
id.endcap()-1][
id.station()-1][chamber]->
fill_x(charge, R, residual, chi2, dof);
442 m_CSCvsphi_me[
id.endcap()-1][
id.station()-1][ring-1]->
fill_x(charge, phi, residual, chi2, dof);
470 std::cout <<
"AlignmentMonitorMuonSystemMap1D counters:"<<std::endl;
485 : m_name(name), m_bins(bins), m_xy(xy), m_1d(add_1d)
488 std::stringstream name_x_2d, name_y_2d, name_dxdz_2d, name_dydz_2d;
489 name_x_2d <<
m_name <<
"_x_2d";
490 name_y_2d << m_name <<
"_y_2d";
491 name_dxdz_2d << m_name <<
"_dxdz_2d";
492 name_dydz_2d << m_name <<
"_dydz_2d";
494 const int nbins = 200;
495 const double window = 100.;
504 std::stringstream name_x_1d;
505 name_x_1d << m_name <<
"_x_1d";
513 if (m_1d && chi2 > 0.) {
515 double residual = residx * 1000.;
516 m_x_1d->Fill(residual);
524 double residual = residx * 10.;
526 m_x_2d->Fill(abscissa, residual);
533 if (m_xy && chi2 > 0.) {
534 double residual = residy * 10.;
536 m_y_2d->Fill(abscissa, residual);
544 double residual = slopex * 1000.;
546 m_dxdz_2d->Fill(abscissa, residual);
553 if (m_xy && chi2 > 0.) {
554 double residual = slopey * 1000.;
556 m_dydz_2d->Fill(abscissa, residual);
double p() const
momentum vector magnitude
double m_maxTrackerRedChi2
AlignableNavigator * pNavigator()
void fill_x(char charge, double abscissa, double residx, double chi2, int dof)
void fill_dydz(char charge, double abscissa, double slopey, double chi2, int dof)
void fill_y(char charge, double abscissa, double residy, double chi2, int dof)
align::GlobalPoint global_trackpos()
TH2F * book2D(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
std::string num02d(int num)
int trackerNumHits() const
void fill_x_1d(double residx, double chi2, int dof)
MuonSystemMapPlot1D * m_CSCvsr_me[2][4][36]
MuonSystemMapPlot1D * m_CSCvsphi_me[2][4][3]
virtual ~AlignmentMonitorMuonSystemMap1D()
double global_residual() const
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks)
Called for each event (by "run()"): may be reimplemented.
const std::vector< DetId > chamberIds() const
double pt() const
track transverse momentum
void book()
Book or retrieve histograms; MUST be reimplemented.
const reco::Track * getTrack()
long m_counter_trackmoment
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
const edm::InputTag m_beamSpotTag
void afterAlignment(const edm::EventSetup &iSetup)
TH1F * book1D(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double pz() const
z coordinate of momentum vector
double normalizedChi2() const
void fill_dxdz(char charge, double abscissa, double slopex, double chi2, int dof)
edm::InputTag m_muonCollectionTag
MuonSystemMapPlot1D * m_DTvsz_station[4][14]
align::GlobalPoint global_stubpos()
std::vector< MuonSystemMapPlot1D * > m_plots
std::vector< std::vector< double > > tmp
MuonSystemMapPlot1D(std::string name, AlignmentMonitorMuonSystemMap1D *module, int bins, double low, double high, bool xy, bool add_1d)
T * make() const
make new ROOT object
long m_counter_cscnumhits
double global_resslope() const
int charge() const
track electric charge
#define DEFINE_EDM_PLUGIN(factory, type, name)
void processMuonResidualsFromTrack(MuonResidualsFromTrack &mrft, const edm::Event &iEvent)
int m_minNCrossedChambers
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Power< A, B >::type pow(const A &a, const B &b)
AlignmentMonitorMuonSystemMap1D(const edm::ParameterSet &cfg)
MuonSystemMapPlot1D * m_DTvsphi_station[4][5]
bool contains_TIDTEC() const
MuonChamberResidual * chamberResidual(DetId chamberId, int type)