18 runningmode_(iConfig.getParameter<
std::string>(
"runningMode")) {
19 std::vector<edm::InputTag> simhits_tags = iConfig.getParameter<std::vector<edm::InputTag>>(
"InputTags");
20 for (
const auto& itag : simhits_tags) {
21 simhits_tokens_.push_back(consumes<std::vector<PSimHit>>(itag));
24 produces<std::vector<unsigned>>(
Prefix +
"hits");
25 produces<std::vector<float>>(
Prefix +
"strip");
26 produces<std::vector<float>>(
Prefix +
"localtheta");
27 produces<std::vector<float>>(
Prefix +
"localphi");
28 produces<std::vector<float>>(
Prefix +
"localx");
29 produces<std::vector<float>>(
Prefix +
"localy");
30 produces<std::vector<float>>(
Prefix +
"localz");
31 produces<std::vector<float>>(
Prefix +
"momentum");
32 produces<std::vector<float>>(
Prefix +
"energyloss");
33 produces<std::vector<float>>(
Prefix +
"time");
34 produces<std::vector<int>>(
Prefix +
"particle");
35 produces<std::vector<unsigned short>>(
Prefix +
"process");
41 int size = clustermap.size();
42 auto hits = std::make_unique<std::vector<unsigned>>(
size, 0);
43 auto strip = std::make_unique<std::vector<float>>(
size, -100);
44 auto localtheta = std::make_unique<std::vector<float>>(
size, -100);
45 auto localphi = std::make_unique<std::vector<float>>(
size, -100);
46 auto localx = std::make_unique<std::vector<float>>(
size, -100);
47 auto localy = std::make_unique<std::vector<float>>(
size, -100);
48 auto localz = std::make_unique<std::vector<float>>(
size, -100);
49 auto momentum = std::make_unique<std::vector<float>>(
size, 0);
50 auto energyloss = std::make_unique<std::vector<float>>(
size, -1);
51 auto time = std::make_unique<std::vector<float>>(
size, -1);
52 auto particle = std::make_unique<std::vector<int>>(
size, -500);
53 auto process = std::make_unique<std::vector<unsigned short>>(
size, 0);
65 const uint32_t
id =
hit.detUnitId();
72 shallow::CLUSTERMAP::const_iterator cluster =
match_cluster(
id, driftedstrip_, clustermap, *
clusters);
73 if (cluster != clustermap.end()) {
74 unsigned i = cluster->second;
76 if (
hits->at(
i) == 1) {
78 localtheta->at(
i) =
hit.thetaAtEntry();
79 localphi->at(
i) =
hit.phiAtEntry();
80 localx->at(
i) =
hit.localPosition().
x();
81 localy->at(
i) =
hit.localPosition().
y();
82 localz->at(
i) =
hit.localPosition().
z();
83 momentum->at(
i) =
hit.pabs();
84 energyloss->at(
i) =
hit.energyLoss();
86 particle->at(
i) =
hit.particleType();
112 shallow::CLUSTERMAP::const_iterator cluster = clustermap.end();
114 if (clustersDetSet !=
clusters.end()) {
116 while (right != clustersDetSet->
end() && strip_ > right->barycenter())
119 if (right != clustersDetSet->
end() && right != clustersDetSet->
begin()) {
120 unsigned firstStrip =
121 (right->barycenter() - strip_) < (strip_ - left->barycenter()) ? right->firstStrip() : left->firstStrip();
122 cluster = clustermap.find(std::make_pair(
id, firstStrip));
123 }
else if (right != clustersDetSet->
begin())
124 cluster = clustermap.find(std::make_pair(
id, left->firstStrip()));
126 cluster = clustermap.find(std::make_pair(
id, right->firstStrip()));
T getParameter(std::string const &) const
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
shallow::CLUSTERMAP::const_iterator match_cluster(const unsigned &, const float &, const shallow::CLUSTERMAP &, const edmNew::DetSetVector< SiStripCluster > &) const
std::vector< edm::EDGetTokenT< std::vector< PSimHit > > > simhits_tokens_
data_type const * const_iterator
const edm::ESGetToken< SiStripLorentzAngle, SiStripLorentzAngleRcd > laToken_
const_iterator end(bool update=false) const
virtual float strip(const LocalPoint &) const =0
ShallowSimhitClustersProducer(const edm::ParameterSet &)
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusters_token_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator begin(bool update=false) const
void produce(edm::Event &, const edm::EventSetup &) override
CLUSTERMAP make_cluster_map(const edm::Event &, const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > &)
std::map< std::pair< uint32_t, uint16_t >, unsigned int > CLUSTERMAP
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_