19 #define TRACKCOLLECTION 1
77 GenPlane(
string name,
double etaminval1,
double etamaxval1,
double etaminval2,
double etamaxval2,
int orderval){
85 order = (double) orderval;
90 if((eta>=etamin1 && eta<etamax1) ||
91 (etamin2!= etamax2 && eta>=etamin2 && eta<etamax2 )) {
101 double getAngle(
double &ang,
double &sv,
double &cv){
107 double q = sv*sv+cv*cv;
108 if(q>0) ang = atan2(sv,cv)/order;
134 virtual void endJob() ;
190 produces<reco::EvtPlaneCollection>(
"recoLevel");
215 using namespace reco;
223 iEvent.
getByLabel(vtxCollection_,vertexCollection3);
225 vs_sell = vertices3->size();
227 vzr_sell = vertices3->begin()->z();
232 if(vzr_sell>minvtx_ && vzr_sell<maxvtx_) {
235 double tower_eta, tower_phi;
236 double tower_energyet, tower_energyet_e, tower_energyet_h;
237 double s1,
s2, s13,s23,s14,s24,s15,s25,s16,s26;
244 tower_eta =
j->eta();
245 tower_phi =
j->phi();
246 tower_energyet_e =
j->emEt();
247 tower_energyet_h =
j->hadEt();
248 tower_energyet = tower_energyet_e + tower_energyet_h;
250 s1 =
sin(2.*tower_phi);
251 s2 =
cos(2.*tower_phi);
252 s13 =
sin(3.*tower_phi);
253 s23 =
cos(3.*tower_phi);
254 s14 =
sin(4.*tower_phi);
255 s24 =
cos(4.*tower_phi);
256 s15 =
sin(5.*tower_phi);
257 s25 =
cos(5.*tower_phi);
258 s16 =
sin(6.*tower_phi);
259 s26 =
cos(6.*tower_phi);
261 if(tower_energyet<minet_)
continue;
262 if(tower_energyet>maxet_)
continue;;
264 rp[
etEcal ]->addParticle (tower_energyet_e, s1, s2, tower_eta);
265 rp[
etEcalP ]->addParticle (tower_energyet_e, s1, s2, tower_eta);
266 rp[
etEcalM ]->addParticle (tower_energyet_e, s1, s2, tower_eta);
267 rp[
etHcal ]->addParticle (tower_energyet_h, s1, s2, tower_eta);
268 rp[
etHcalP ]->addParticle (tower_energyet_h, s1, s2, tower_eta);
269 rp[
etHcalM ]->addParticle (tower_energyet_h, s1, s2, tower_eta);
270 rp[
etHF ]->addParticle (tower_energyet, s1, s2, tower_eta);
271 rp[
etHFp ]->addParticle (tower_energyet, s1, s2, tower_eta);
272 rp[
etHFm ]->addParticle (tower_energyet, s1, s2, tower_eta);
273 rp[
etCaloHFP ]->addParticle (tower_energyet, s1, s2, tower_eta);
274 rp[
etCaloHFM ]->addParticle (tower_energyet, s1, s2, tower_eta);
276 rp[
etHF3 ]->addParticle (tower_energyet, s13, s23, tower_eta);
277 rp[
etHFp3 ]->addParticle (tower_energyet, s13, s23, tower_eta);
278 rp[
etHFm3 ]->addParticle (tower_energyet, s13, s23, tower_eta);
280 rp[
etHF4 ]->addParticle (tower_energyet, s14, s24, tower_eta);
281 rp[
etHFp4 ]->addParticle (tower_energyet, s14, s24, tower_eta);
282 rp[
etHFm4 ]->addParticle (tower_energyet, s14, s24, tower_eta);
284 rp[
etHF5 ]->addParticle (tower_energyet, s15, s25, tower_eta);
285 rp[
etHFp5 ]->addParticle (tower_energyet, s15, s25, tower_eta);
286 rp[
etHFm5 ]->addParticle (tower_energyet, s15, s25, tower_eta);
288 rp[
etHF6 ]->addParticle (tower_energyet, s16, s26, tower_eta);
289 rp[
etHFp6 ]->addParticle (tower_energyet, s16, s26, tower_eta);
290 rp[
etHFm6 ]->addParticle (tower_energyet, s16, s26, tower_eta);
298 #ifdef TRACKCOLLECTION
303 for(reco::TrackCollection::const_iterator
j = tracks->begin();
j != tracks->end();
j++){
307 #ifdef RECOCHARGEDCANDIDATECOLLECTION
309 iEvent.
getByLabel(
"allMergedPtSplit12Tracks",trackCollection);
314 for(reco::RecoChargedCandidateCollection::const_iterator
j = tracks->begin();
j != tracks->end();
j++){
322 double vzErr =0.0, vxErr=0.0, vyErr=0.0;
323 if(vertex->size()>0) {
324 vtxPoint=vertex->begin()->position();
325 vzErr=vertex->begin()->zError();
326 vxErr=vertex->begin()->xError();
327 vyErr=vertex->begin()->yError();
329 bool accepted =
true;
330 bool isPixel =
false;
332 if (
j->numberOfValidHits() < 7 ) isPixel =
true;
335 double d0=0.0, dz=0.0, d0sigma=0.0, dzsigma=0.0;
336 d0 = -1.*
j->dxy(vtxPoint);
337 dz =
j->dz(vtxPoint);
338 d0sigma =
sqrt(
j->d0Error()*
j->d0Error()+vxErr*vyErr);
339 dzsigma =
sqrt(
j->dzError()*
j->dzError()+vzErr*vzErr);
345 if ( fabs(dz/dzsigma) > dzerr_ ) accepted =
false;
348 if (
j->normalizedChi2() > chi2_ ) accepted =
false;
355 if ( fabs(dz/dzsigma) > 3 ) accepted =
false;
356 if ( fabs(d0/d0sigma) > 3 ) accepted =
false;
359 if (
j->ptError()/
j->pt() > 0.05 ) accepted =
false;
362 if (
j->numberOfValidHits() < 12 ) accepted =
false;
365 track_eta =
j->eta();
366 track_phi =
j->phi();
368 double s =
sin(2*track_phi);
369 double c =
cos(2*track_phi);
370 double s3 =
sin(3*track_phi);
371 double c3 =
cos(3*track_phi);
372 double s4 =
sin(4*track_phi);
373 double c4 =
cos(4*track_phi);
374 double s5 =
sin(5*track_phi);
375 double c5 =
cos(5*track_phi);
376 double s6 =
sin(6*track_phi);
377 double c6 =
cos(6*track_phi);
379 if(useTrackPtWeight_) {
383 if(track_pt<minpt_)
continue;
384 if(track_pt>maxpt_)
continue;
415 rp[
i]->getAngle(ang,sv,cv);
420 for(
int i = 0;
i<9;
i++) {
421 evtplaneOutput->push_back(*ep[
i]);
425 if(useECAL_ && !useHCAL_) {
426 if(
EPNames[
i].rfind(
"Ecal")!=string::npos) {
427 evtplaneOutput->push_back(*ep[
i]);
429 }
else if (useHCAL_ && !useECAL_) {
430 if(
EPNames[
i].rfind(
"Hcal")!=string::npos) {
431 evtplaneOutput->push_back(*ep[
i]);
433 }
else if (useECAL_ && useHCAL_) {
434 evtplaneOutput->push_back(*ep[
i]);
438 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)
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[]
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Cos< T >::type cos(const T &t)
std::vector< EvtPlane > EvtPlaneCollection
virtual void produce(edm::Event &, const edm::EventSetup &)
EvtPlaneProducer(const edm::ParameterSet &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
void addParticle(double w, double s, double c, double eta)
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
char data[epos_bytes_allocation]
edm::InputTag caloCollection_
edm::InputTag vtxCollection_
static const int NumEPNames
edm::InputTag trackCollection_
void reset(double vett[256])