19 : clusters_token_( consumes<
edmNew::DetSetVector<
SiStripCluster> >(iConfig.getParameter<
edm::InputTag>(
"Clusters"))),
20 Prefix( iConfig.getParameter<
std::
string>(
"Prefix") ),
21 runningmode_( iConfig.getParameter<
std::
string>(
"runningMode") )
23 std::vector<edm::InputTag> simhits_tags = iConfig.
getParameter<std::vector<edm::InputTag> >(
"InputTags");
24 for(
auto itag : simhits_tags) {
26 consumes< std::vector<PSimHit> >(itag)
30 produces <std::vector<unsigned> > (
Prefix +
"hits" );
31 produces <std::vector<float> > (
Prefix +
"strip" );
32 produces <std::vector<float> > (
Prefix +
"localtheta" );
33 produces <std::vector<float> > (
Prefix +
"localphi" );
34 produces <std::vector<float> > (
Prefix +
"localx" );
35 produces <std::vector<float> > (
Prefix +
"localy" );
36 produces <std::vector<float> > (
Prefix +
"localz" );
37 produces <std::vector<float> > (
Prefix +
"momentum" );
38 produces <std::vector<float> > (
Prefix +
"energyloss" );
39 produces <std::vector<float> > (
Prefix +
"time" );
40 produces <std::vector<int> > (
Prefix +
"particle" );
41 produces <std::vector<unsigned short> > (
Prefix +
"process" );
48 int size = clustermap.size();
49 auto hits = std::make_unique <std::vector<unsigned>> (
size, 0);
50 auto strip = std::make_unique <std::vector<float>> (
size, -100);
51 auto localtheta = std::make_unique <std::vector<float>> (
size, -100);
52 auto localphi = std::make_unique <std::vector<float>> (
size, -100);
53 auto localx = std::make_unique <std::vector<float>> (
size, -100);
54 auto localy = std::make_unique <std::vector<float>> (
size, -100);
55 auto localz = std::make_unique <std::vector<float>> (
size, -100);
56 auto momentum = std::make_unique <std::vector<float>> (
size, 0);
57 auto energyloss = std::make_unique <std::vector<float>> (
size, -1);
58 auto time = std::make_unique <std::vector<float>> (
size, -1);
59 auto particle = std::make_unique <std::vector<int>> (
size, -500);
60 auto process = std::make_unique <std::vector<unsigned short>> (
size, 0);
70 for(
auto const&
hit : *simhits ) {
72 const uint32_t
id =
hit.detUnitId();
79 shallow::CLUSTERMAP::const_iterator cluster =
match_cluster(
id, driftedstrip_, clustermap, *clusters);
80 if(cluster != clustermap.end()) {
81 unsigned i = cluster->second;
83 if(
hits->at(i) == 1) {
84 strip->at(i) = hitstrip_;
85 localtheta->at(i) =
hit.thetaAtEntry();
86 localphi->at(i) =
hit.phiAtEntry();
87 localx->at(i) =
hit.localPosition().
x();
88 localy->at(i) =
hit.localPosition().
y();
89 localz->at(i) =
hit.localPosition().
z();
90 momentum->at(i) =
hit.pabs();
91 energyloss->at(i) =
hit.energyLoss();
92 time->at(i) =
hit.timeOfFlight();
93 particle->at(i) =
hit.particleType();
94 process->at(i) =
hit.processType();
116 shallow::CLUSTERMAP::const_iterator cluster = clustermap.end();
118 if( clustersDetSet != clusters.
end() ) {
120 while( right != clustersDetSet->
end() && strip_ > right->barycenter() )
123 if(right!=clustersDetSet->
end() && right!=clustersDetSet->
begin()) {
124 unsigned firstStrip = (right->barycenter()-strip_) < (strip_-left->barycenter()) ? right->firstStrip() : left->firstStrip();
125 cluster = clustermap.find( std::make_pair(
id, firstStrip));
127 else if(right != clustersDetSet->
begin())
128 cluster = clustermap.find( std::make_pair(
id, left->firstStrip()));
130 cluster = clustermap.find( std::make_pair(
id, right->firstStrip()));
T getParameter(std::string const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
shallow::CLUSTERMAP::const_iterator match_cluster(const unsigned &, const float &, const shallow::CLUSTERMAP &, const edmNew::DetSetVector< SiStripCluster > &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
virtual float strip(const LocalPoint &) const =0
data_type const * const_iterator
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ShallowSimhitClustersProducer(const edm::ParameterSet &)
const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusters_token_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void produce(edm::Event &, const edm::EventSetup &) override
const_iterator find(id_type i, bool update=false) const
CLUSTERMAP make_cluster_map(const edm::Event &, const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > &)
std::map< std::pair< uint32_t, uint16_t >, unsigned int > CLUSTERMAP
std::vector< edm::EDGetTokenT< std::vector< PSimHit > > > simhits_tokens_
const_iterator begin(bool update=false) const