18 #define TRACKCOLLECTION 1
75 GenPlane(
string name,
double etaminval1,
double etamaxval1,
double etaminval2,
double etamaxval2,
int orderval){
83 order = (double) orderval;
88 if((eta>=etamin1 && eta<etamax1) ||
89 (etamin2!= etamax2 && eta>=etamin2 && eta<etamax2 )) {
105 double q = sv*sv+cv*
cv;
106 if(q>0) ang = atan2(sv,cv)/order;
132 virtual void endJob()
override ;
188 produces<reco::EvtPlaneCollection>(
"recoLevel");
213 using namespace reco;
221 iEvent.
getByLabel(vtxCollection_,vertexCollection3);
223 vs_sell = vertices3->size();
225 vzr_sell = vertices3->begin()->z();
230 if(vzr_sell>minvtx_ && vzr_sell<maxvtx_) {
233 double tower_eta, tower_phi;
234 double tower_energyet, tower_energyet_e, tower_energyet_h;
235 double s1,
s2, s13,s23,s14,s24,s15,s25,s16,s26;
242 tower_eta =
j->eta();
243 tower_phi =
j->phi();
244 tower_energyet_e =
j->emEt();
245 tower_energyet_h =
j->hadEt();
246 tower_energyet = tower_energyet_e + tower_energyet_h;
248 s1 =
sin(2.*tower_phi);
249 s2 =
cos(2.*tower_phi);
250 s13 =
sin(3.*tower_phi);
251 s23 =
cos(3.*tower_phi);
252 s14 =
sin(4.*tower_phi);
253 s24 =
cos(4.*tower_phi);
254 s15 =
sin(5.*tower_phi);
255 s25 =
cos(5.*tower_phi);
256 s16 =
sin(6.*tower_phi);
257 s26 =
cos(6.*tower_phi);
259 if(tower_energyet<minet_)
continue;
260 if(tower_energyet>maxet_)
continue;;
262 rp[
etEcal ]->addParticle (tower_energyet_e, s1, s2, tower_eta);
263 rp[
etEcalP ]->addParticle (tower_energyet_e, s1, s2, tower_eta);
264 rp[
etEcalM ]->addParticle (tower_energyet_e, s1, s2, tower_eta);
265 rp[
etHcal ]->addParticle (tower_energyet_h, s1, s2, tower_eta);
266 rp[
etHcalP ]->addParticle (tower_energyet_h, s1, s2, tower_eta);
267 rp[
etHcalM ]->addParticle (tower_energyet_h, s1, s2, tower_eta);
268 rp[
etHF ]->addParticle (tower_energyet, s1, s2, tower_eta);
269 rp[
etHFp ]->addParticle (tower_energyet, s1, s2, tower_eta);
270 rp[
etHFm ]->addParticle (tower_energyet, s1, s2, tower_eta);
271 rp[
etCaloHFP ]->addParticle (tower_energyet, s1, s2, tower_eta);
272 rp[
etCaloHFM ]->addParticle (tower_energyet, s1, s2, tower_eta);
274 rp[
etHF3 ]->addParticle (tower_energyet, s13, s23, tower_eta);
275 rp[
etHFp3 ]->addParticle (tower_energyet, s13, s23, tower_eta);
276 rp[
etHFm3 ]->addParticle (tower_energyet, s13, s23, tower_eta);
278 rp[
etHF4 ]->addParticle (tower_energyet, s14, s24, tower_eta);
279 rp[
etHFp4 ]->addParticle (tower_energyet, s14, s24, tower_eta);
280 rp[
etHFm4 ]->addParticle (tower_energyet, s14, s24, tower_eta);
282 rp[
etHF5 ]->addParticle (tower_energyet, s15, s25, tower_eta);
283 rp[
etHFp5 ]->addParticle (tower_energyet, s15, s25, tower_eta);
284 rp[
etHFm5 ]->addParticle (tower_energyet, s15, s25, tower_eta);
286 rp[
etHF6 ]->addParticle (tower_energyet, s16, s26, tower_eta);
287 rp[
etHFp6 ]->addParticle (tower_energyet, s16, s26, tower_eta);
288 rp[
etHFm6 ]->addParticle (tower_energyet, s16, s26, tower_eta);
296 #ifdef TRACKCOLLECTION
301 for(reco::TrackCollection::const_iterator
j = tracks->begin();
j != tracks->end();
j++){
305 #ifdef RECOCHARGEDCANDIDATECOLLECTION
307 iEvent.
getByLabel(
"allMergedPtSplit12Tracks",trackCollection);
312 for(reco::RecoChargedCandidateCollection::const_iterator
j = tracks->begin();
j != tracks->end();
j++){
320 double vzErr =0.0, vxErr=0.0, vyErr=0.0;
321 if(vertex->size()>0) {
322 vtxPoint=vertex->begin()->position();
323 vzErr=vertex->begin()->zError();
324 vxErr=vertex->begin()->xError();
325 vyErr=vertex->begin()->yError();
327 bool accepted =
true;
328 bool isPixel =
false;
330 if (
j->numberOfValidHits() < 7 ) isPixel =
true;
333 double d0=0.0, dz=0.0, d0sigma=0.0, dzsigma=0.0;
334 d0 = -1.*
j->dxy(vtxPoint);
335 dz =
j->dz(vtxPoint);
336 d0sigma =
sqrt(
j->d0Error()*
j->d0Error()+vxErr*vyErr);
337 dzsigma =
sqrt(
j->dzError()*
j->dzError()+vzErr*vzErr);
343 if ( fabs(dz/dzsigma) > dzerr_ ) accepted =
false;
346 if (
j->normalizedChi2() > chi2_ ) accepted =
false;
353 if ( fabs(dz/dzsigma) > 3 ) accepted =
false;
354 if ( fabs(d0/d0sigma) > 3 ) accepted =
false;
357 if (
j->ptError()/
j->pt() > 0.05 ) accepted =
false;
360 if (
j->numberOfValidHits() < 12 ) accepted =
false;
363 track_eta =
j->eta();
364 track_phi =
j->phi();
366 double s =
sin(2*track_phi);
367 double c =
cos(2*track_phi);
368 double s3 =
sin(3*track_phi);
369 double c3 =
cos(3*track_phi);
370 double s4 =
sin(4*track_phi);
371 double c4 =
cos(4*track_phi);
372 double s5 =
sin(5*track_phi);
373 double c5 =
cos(5*track_phi);
374 double s6 =
sin(6*track_phi);
375 double c6 =
cos(6*track_phi);
377 if(useTrackPtWeight_) {
381 if(track_pt<minpt_)
continue;
382 if(track_pt>maxpt_)
continue;
413 rp[
i]->getAngle(ang,sv,cv);
418 for(
int i = 0;
i<9;
i++) {
419 evtplaneOutput->push_back(*ep[
i]);
423 if(useECAL_ && !useHCAL_) {
424 if(
EPNames[
i].rfind(
"Ecal")!=string::npos) {
425 evtplaneOutput->push_back(*ep[
i]);
427 }
else if (useHCAL_ && !useECAL_) {
428 if(
EPNames[
i].rfind(
"Hcal")!=string::npos) {
429 evtplaneOutput->push_back(*ep[
i]);
431 }
else if (useECAL_ && useHCAL_) {
432 evtplaneOutput->push_back(*ep[
i]);
436 iEvent.
put(evtplaneOutput,
"recoLevel");
double getAngle(double &ang, double &sv, double &cv)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
GenPlane(string name, double etaminval1, double etamaxval1, double etaminval2, double etamaxval2, int orderval)
#define DEFINE_FWK_MODULE(type)
virtual void beginJob() override
Sin< T >::type sin(const T &t)
std::vector< CaloTower >::const_iterator const_iterator
std::vector< Vertex > VertexCollection
collection of Vertex objects
const std::string EPNames[]
virtual void produce(edm::Event &, const edm::EventSetup &) override
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void endJob() override
Cos< T >::type cos(const T &t)
std::vector< EvtPlane > EvtPlaneCollection
EvtPlaneProducer(const edm::ParameterSet &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
T const * product() const
void addParticle(double w, double s, double c, double eta)
XYZPointD XYZPoint
point in space with cartesian internal representation
char data[epos_bytes_allocation]
edm::InputTag caloCollection_
edm::InputTag vtxCollection_
static const int NumEPNames
edm::InputTag trackCollection_
void reset(double vett[256])