115 using namespace reco;
121 desc.
add<
string>(
"estimator",
"generic");
123 desc.
add<
bool>(
"UsePixel",
false);
124 desc.
add<
bool>(
"UseStrip",
true);
125 desc.
add<
double>(
"MeVperADCStrip",3.61e-06*265);
126 desc.
add<
double>(
"MeVperADCPixel",3.61e-06);
127 desc.
add<
bool>(
"ShapeTest",
true);
128 desc.
add<
bool>(
"UseCalibration",
false);
129 desc.
add<
string>(
"calibrationPath",
"");
130 desc.
add<
string>(
"Reccord",
"SiStripDeDxMip_3D_Rcd");
131 desc.
add<
string>(
"ProbabilityMode",
"Accumulation");
132 desc.
add<
double>(
"fraction", 0.4);
133 desc.
add<
double>(
"exponent",-2.0);
134 desc.
add<
bool>(
"convertFromGeV2MeV",
true);
135 desc.
add<
bool>(
"nothick",
false);
138 descriptions.
add(
"FastTrackDeDxProducer",desc);
146 produces<ValueMap<DeDxData> >();
148 string estimatorName = iConfig.
getParameter<
string>(
"estimator");
157 else throw cms::Exception(
"fastsim::SimplifiedGeometry::FastTrackDeDxProducer.cc") <<
" estimator name does not exist";
177 throw cms::Exception(
"fastsim::SimplifiedGeometry::FastTrackDeDxProducer.cc") <<
" neither pixel hits nor strips hits will be used to compute de/dx";
201 auto trackDeDxEstimateAssociation = std::make_unique<ValueMap<DeDxData>>();
214 int NClusterSaturating = 0;
217 auto const & trajParams = track->extra()->trajParams();
218 assert(trajParams.size()==track->recHitsSize());
220 auto hb = track->recHitsBegin();
221 dedxHits.reserve(track->recHitsSize()/2);
225 for(
unsigned int h=0;
h<track->recHitsSize();
h++){
227 if(!recHit.
isValid())
continue;
228 auto trackDirection = trajParams[
h].direction();
229 float cosine = trackDirection.z()/trackDirection.mag();
230 processHit(recHit, track->p(), cosine, dedxHits, NClusterSaturating);
233 sort(dedxHits.begin(),dedxHits.end(),less<DeDxHit>());
234 std::pair<float,float> val_and_error =
m_estimator->dedx(dedxHits);
237 val_and_error.second = NClusterSaturating;
238 dedxEstimate[j] =
DeDxData(val_and_error.first, val_and_error.second, dedxHits.size() );
242 filler.insert(trackCollectionHandle, dedxEstimate.begin(), dedxEstimate.end());
254 if (!thit.isValid())
return;
256 if (!thit.hasPositionAndError())
return;
261 auto& detUnit = *(recHit.
detUnit());
270 auto& detUnit = *(recHit.
detUnit());
271 float pathLen = detUnit.surface().bounds().thickness()/fabs(cosine);
273 float dedxOfRecHit = recHit.
energyLoss()/pathLen;
T getParameter(std::string const &) const
void makeCalibrationMap(const TrackerGeometry &tkGeom)
FastTrackDeDxProducer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void processHit(const FastTrackerRecHit &recHit, float trackMomentum, float &cosine, reco::DeDxHitCollection &dedxHits, int &NClusterSaturating)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::TrackCollection > m_tracksTag
std::vector< DeDxHit > DeDxHitCollection
const Bounds & bounds() const
~FastTrackDeDxProducer() override=default
unsigned int offsetDU(SubDetector sid) const
edm::EDGetTokenT< FastTrackerRecHitRefCollection > simHit2RecHitMapToken
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken
void beginRun(edm::Run const &run, const edm::EventSetup &) override
T const * product() const
virtual float thickness() const =0
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool isPixel() const override
pixel or strip?
std::vector< std::vector< float > > calibGains
const Surface * surface() const final
std::vector< FastTrackerRecHitRef > FastTrackerRecHitRefCollection
virtual const GeomDetUnit * detUnit() const
std::string m_calibrationPath
std::unique_ptr< BaseDeDxEstimator > m_estimator
std::vector< PSimHit > PSimHitContainer
DetId geographicalId() const
void produce(edm::Event &, const edm::EventSetup &) override