59 theMatcher_ = std::make_unique<MuonSegmentMatcher>(matchParameters, iC);
124 <<
" # of points: " << combinedTime.
nDof() <<std::endl;
133 std::vector <double>
x,
y;
134 double invbeta=0, invbetaerr=0;
135 double vertexTime=0, vertexTimeErr=0, vertexTimeR=0, vertexTimeRErr=0;
136 double freeBeta, freeBetaErr, freeTime, freeTimeErr;
138 if (tmSeq.
dstnc.size()<=1)
return;
140 for (
unsigned int i=0;
i<tmSeq.
dstnc.size();
i++) {
142 x.push_back(tmSeq.
dstnc.at(
i)/30.);
149 for (
unsigned int i=0;
i<tmSeq.
dstnc.size();
i++) {
158 double cf = 1./(tmSeq.
dstnc.size()-1);
170 rawFit(freeBeta, freeBetaErr, freeTime, freeTimeErr, x, y);
183 double trpc=0,trpc2=0,trpcerr=0;
186 if (staTrack.
isNull())
return;
188 std::vector<const RPCRecHit*> rpcHits =
theMatcher_->matchRPC(*staTrack,iEvent);
189 for (std::vector<const RPCRecHit*>::const_iterator hitRPC = rpcHits.begin(); hitRPC != rpcHits.end(); hitRPC++) {
191 trpc+=(*hitRPC)->BunchX();
192 trpc2+=(*hitRPC)->BunchX()*(*hitRPC)->BunchX();
197 trpc2=trpc2/(double)nrpc*25.*25.;
198 trpc=trpc/(double)nrpc*25.;
199 trpcerr=
sqrt(trpc2-trpc*trpc);
255 double hitWeight = 1/(emErr*emErr);
260 cmbSeq.
weightInvbeta.push_back(hitDist*hitDist*hitWeight/(30.*30.));
262 cmbSeq.
dstnc.push_back(hitDist);
278 if (hitsx.size()==0)
return;
279 if (hitsx.size()==1) {
282 for (
unsigned int i = 0;
i != hitsx.size();
i++) {
292 double d = s*sxx -
sx*
sx;
293 b = (sxx*
sy- sx*sxy)/ d;
294 a = (s*sxy - sx*
sy) / 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_
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)
float ecal_time
Calorimeter timing.
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_
float timeAtIpOutIn
b) particle is moving from outside in
int nDof
number of muon stations used
std::vector< double > weightInvbeta
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool isNull() const
Checks for null.
void fillTimeFromMeasurements(const TimeMeasurementSequence &tmSeq, reco::MuonTimeExtra &muTime)
bool isEnergyValid() const
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
virtual TrackRef combinedMuon() const
reference to a stand-alone muon Track
std::vector< double > weightTimeVtx
DetId ecal_id
DetId of the central ECAL crystal.
std::vector< double > dstnc
math::XYZPointF ecal_position
Trajectory position at the calorimeter.
virtual TrackRef standAloneMuon() const
reference to a stand-alone muon Track