59 theMatcher_ = std::make_unique<MuonSegmentMatcher>(matchParameters, iC);
103 std::vector<const DTRecSegment4D*> dtSegments;
106 for (
auto& segment :
chamber.segmentMatches ){
112 if ( !(segment.dtSegmentRef.isNull()))
113 dtSegments.push_back(segment.dtSegmentRef.get());
114 if ( !(segment.cscSegmentRef.isNull()))
115 cscSegments.push_back(segment.cscSegmentRef.get());
146 <<
" # of points: " << combinedTime.
nDof() <<std::endl;
155 std::vector <double>
x,
y;
156 double invbeta(0), invbetaerr(0);
157 double vertexTime(0), vertexTimeErr(0), vertexTimeR(0), vertexTimeRErr(0);
158 double freeBeta(0), freeBetaErr(0), freeTime(0), freeTimeErr(0);
160 if (tmSeq.
dstnc.size()<=1)
return;
162 for (
unsigned int i=0;
i<tmSeq.
dstnc.size();
i++) {
164 x.push_back(tmSeq.
dstnc.at(
i)/30.);
171 for (
unsigned int i=0;
i<tmSeq.
dstnc.size();
i++) {
180 double cf = 1./(tmSeq.
dstnc.size()-1);
192 rawFit(freeBeta, freeBetaErr, freeTime, freeTimeErr, x, y);
204 double trpc=0,trpc2=0;
207 if (staTrack.
isNull())
return;
209 const std::vector<const RPCRecHit*> rpcHits =
theMatcher_->matchRPC(*staTrack,iEvent);
210 const int nrpc = rpcHits.size();
211 for (
const auto& hitRPC : rpcHits ) {
212 const double time = hitRPC->timeError() < 0 ? hitRPC->BunchX()*25. : hitRPC->time();
221 const double trpcerr =
sqrt(
std::max(0., trpc2-trpc*trpc));
277 double hitWeight = 1/(emErr*emErr);
282 cmbSeq.
weightInvbeta.push_back(hitDist*hitDist*hitWeight/(30.*30.));
284 cmbSeq.
dstnc.push_back(hitDist);
295 const std::vector<double>& hitsx,
const std::vector<double>& hitsy) {
305 if (hitsx.empty())
return;
306 if (hitsx.size()==1) {
309 for (
unsigned int i = 0;
i != hitsx.size();
i++) {
319 double d = s*sxx -
sx*
sx;
320 freeTime = (sxx*
sy- sx*sxy)/ d;
321 freeBeta = (s*sxy - sx*
sy) / d;
322 freeBetaErr =
sqrt(sxx/d);
323 freeTimeErr =
sqrt(s/d);
T getParameter(std::string const &) const
void addEcalTime(const reco::Muon &muon, TimeMeasurementSequence &cmbSeq)
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
void combineTMSequences(const reco::Muon &muon, const TimeMeasurementSequence &dtSeq, const TimeMeasurementSequence &cscSeq, TimeMeasurementSequence &cmbSeq)
std::vector< double > local_t0
std::unique_ptr< DTTimingExtractor > theDTTimingExtractor_
virtual TrackRef innerTrack() const
void fillRPCTime(const reco::Muon &muon, reco::MuonTime &muTime, edm::Event &iEvent)
void fillTiming(const reco::Muon &muon, reco::MuonTimeExtra &dtTime, reco::MuonTimeExtra &cscTime, reco::MuonTime &rpcTime, reco::MuonTimeExtra &combinedTime, edm::Event &iEvent, const edm::EventSetup &iSetup)
double totalWeightTimeVtx
MuonTimingFiller(const edm::ParameterSet &, edm::ConsumesCollector &&iC)
static const unsigned int BestInStationByDR
float ecal_time
Calorimeter timing.
bool isTrackerMuon() const override
void rawFit(double &a, double &da, double &b, double &db, const std::vector< double > &hitsx, const std::vector< double > &hitsy)
std::unique_ptr< MuonSegmentMatcher > theMatcher_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
float timeAtIpOutIn
b) particle is moving from outside in
int nDof
number of muon stations used
std::vector< double > weightInvbeta
bool isNull() const
Checks for null.
void fillTimeFromMeasurements(const TimeMeasurementSequence &tmSeq, reco::MuonTimeExtra &muTime)
bool isEnergyValid() const
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
std::unique_ptr< CSCTimingExtractor > theCSCTimingExtractor_
MuonEnergy calEnergy() const
get energy deposition information
float emMax
maximal energy of ECAL crystal in the 5x5 shape
double totalWeightInvbeta
std::vector< double > weightTimeVtx
TrackRef combinedMuon() const override
reference to a stand-alone muon Track
std::vector< MuonChamberMatch > & matches()
get muon matching information
DetId ecal_id
DetId of the central ECAL crystal.
static const unsigned int BelongsToTrackByDR
std::vector< double > dstnc
math::XYZPointF ecal_position
Trajectory position at the calorimeter.