19 for (
unsigned i=0;
i<bFields.size(); ++
i ) {
21 cout <<
"r/z/b = " <<
rBounds[
i] <<
" " << zBounds[
i] <<
" " << bFields[
i] << endl;
24 if(trig_==0){
cout <<endl <<
"trigger is both + and - BSC " << endl;}
25 if(trig_==1){
cout <<endl <<
"trigger is + side BSC " << endl;}
26 if(trig_==-1){
cout <<endl <<
"trigger is - side BSC " << endl;}
30 if(trig2_==0){
cout <<endl <<
"trigger is both PADs and DISKs " << endl;}
31 if(trig2_==-1){
cout <<endl <<
"trigger is only PADs " << endl;}
32 if(trig2_==1){
cout <<endl <<
"trigger is only DISKs " << endl;}
34 if(trig_!=0 && trig_!=-1 && trig_!=1 && trig2_!=0 && trig2_!=-1 && trig2_!=1)
36 cout <<endl << endl <<endl<<
"WARNING!! BSC trigger/scintillator type not properly defined " << endl;
37 cout <<endl << endl <<endl<<
"WARNING!! BSC trigger/scintillator type not properly defined " << endl << endl << endl;
47 iEvent.
getByLabel(
"generator",
"unsmeared",HepMCEvt);
51 map<unsigned,XYZTLorentzVector> myHits;
55 for(HepMC::GenEvent::particle_const_iterator
i=MCEvt->particles_begin();
i != MCEvt->particles_end();++
i)
65 int myId = (*i)->pdg_id();
68 const HepMC::GenVertex * vertex_=(*i)->production_vertex();
69 double xv = vertex_->position().x();
70 double yv = vertex_->position().y();
71 double zv = vertex_->position().z();
72 double tv = vertex_->position().t();
83 myMuon.setCharge(-1.);
85 myMuon.setCharge(+1.);
93 float px0=momentum.x();
94 float py0=momentum.y();
95 float pz0=momentum.z();
103 float ys = (zs-z0)*(py0/pz0)+y0;
104 float xs = (ys-y0)*(px0/py0)+x0;
107 if(xs<0 && ys>0) {xs=-xs;}
108 if(xs>0 && ys<0) {ys=-ys;}
109 if(xs<0 && ys<0) {xs=-xs; ys=-ys;}
113 float A[2]={732.7, 24.7};
114 float B[2]={895.3, 187.3};
115 float C[2]={144.0, 850.2};
116 float D[2]={69.8, 776.0};
117 float m1=(B[1]-A[1])/(B[0]-A[0]);
118 float m2=(C[1]-B[1])/(C[0]-B[0]);
119 float m3=(D[1]-C[1])/(D[0]-C[0]);
120 float m4=(A[1]-D[1])/(A[0]-D[0]);
121 float y1=m1*(xs-A[0])+A[1];
122 float y2=m2*(xs-B[0])+B[1];
123 float y3=m3*(xs-C[0])+C[1];
124 float y4=m4*(xs-D[0])+D[1];
131 if(ys>y1 && ys<y2 && ys<y3 && ys>y4)
137 if((ys<
sqrt(450*450-xs*xs) && ys>
sqrt(208*208-xs*xs)) || (ys<
sqrt(450*450-xs*xs) && xs>208))
146 ys = (zs-z0)*(py0/pz0)+y0;
147 xs = (ys-y0)*(px0/py0)+x0;
152 if(xs<0 && ys>0) {xs=-xs;}
153 if(xs>0 && ys<0) {ys=-ys;}
154 if(xs<0 && ys<0) {xs=-xs; ys=-ys;}
158 y1=m1*(xs-A[0])+A[1];
159 y2=m2*(xs-B[0])+B[1];
160 y3=m3*(xs-C[0])+C[1];
161 y4=m4*(xs-D[0])+D[1];
167 if(ys>y1 && ys<y2 && ys<y3 && ys>y4)
173 if((ys<
sqrt(450*450-xs*xs) && ys>
sqrt(208*208-xs*xs)) || (ys<
sqrt(450*450-xs*xs) && xs>208))
T getParameter(std::string const &) const
std::vector< double > bFields
bool filter(edm::Event &iEvent, edm::EventSetup const &c) override
static const std::string B
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Namespace of DDCMS conversion namespace.
std::vector< double > zBounds
const HepMC::GenEvent * GetEvent() const
DecomposeProduct< arg, typename Div::arg > D
std::vector< double > rBounds
math::XYZTLorentzVector XYZTLorentzVector