79 GenPlane(
string name,
double etaminval1,
double etamaxval1,
double etaminval2,
double etamaxval2,
int orderval){
91 order = (double) orderval;
95 if((eta>=etamin1 && eta<etamax1) ||
96 (etamin2!= etamax2 && eta>=etamin2 && eta<etamax2 )) {
105 sumPtOrEt2+=PtOrEt*PtOrEt;
110 double getAngle(
double &ang,
double &sv,
double &
cv,
double &svNoWgt,
double &cvNoWgt,
double &
w,
double &
w2,
double &PtOrEt,
double &PtOrEt2,
uint &epmult){
116 svNoWgt = sumsinNoWgt;
117 cvNoWgt = sumcosNoWgt;
121 PtOrEt2 = sumPtOrEt2;
123 double q = sv*sv+cv*
cv;
124 if(q>0) ang = atan2(sv,cv)/order;
216 centralityVariable_ ( iConfig.getParameter<
std::
string>(
"centralityVariable") ),
217 centralityBinTag_ ( iConfig.getParameter<
edm::InputTag>(
"centralityBinTag") ),
218 vertexTag_ ( iConfig.getParameter<
edm::InputTag>(
"vertexTag") ),
219 caloTag_ ( iConfig.getParameter<
edm::InputTag>(
"caloTag") ),
220 castorTag_ ( iConfig.getParameter<
edm::InputTag>(
"castorTag") ),
221 trackTag_ ( iConfig.getParameter<
edm::InputTag>(
"trackTag") ),
222 loadDB_ ( iConfig.getParameter<
bool>(
"loadDB") ),
223 minet_ ( iConfig.getParameter<double>(
"minet") ),
224 maxet_ ( iConfig.getParameter<double>(
"maxet") ),
225 minpt_ ( iConfig.getParameter<double>(
"minpt") ),
226 maxpt_ ( iConfig.getParameter<double>(
"maxpt") ),
227 minvtx_ ( iConfig.getParameter<double>(
"minvtx") ),
228 maxvtx_ ( iConfig.getParameter<double>(
"maxvtx") ),
229 dzerr_ ( iConfig.getParameter<double>(
"dzerr") ),
230 chi2_ ( iConfig.getParameter<double>(
"chi2") ),
231 FlatOrder_ ( iConfig.getParameter<
int>(
"FlatOrder") ),
232 NumFlatBins_ ( iConfig.getParameter<
int>(
"NumFlatBins") ),
233 caloCentRef_ ( iConfig.getParameter<double>(
"caloCentRef") ),
234 caloCentRefWidth_ ( iConfig.getParameter<double>(
"caloCentRefWidth") ),
235 CentBinCompression_ ( iConfig.getParameter<
int>(
"CentBinCompression") )
240 if(iConfig.
exists(
"nonDefaultGlauberModel")){
255 produces<reco::EvtPlaneCollection>();
289 using namespace reco;
304 if(minbin>0 && maxbin>=minbin) {
343 vs_sell = vertices3->size();
346 vzr_sell = vertices3->begin()->z();
351 if(vzr_sell<minvtx_ or vzr_sell>
maxvtx_)
return;
355 double tower_eta, tower_phi;
356 double tower_energyet, tower_energyet_e, tower_energyet_h;
362 tower_eta = j->eta();
363 tower_phi = j->phi();
364 tower_energyet_e = j->emEt();
365 tower_energyet_h = j->hadEt();
366 tower_energyet = tower_energyet_e + tower_energyet_h;
372 if(tower_energyet<minet)
continue;
373 if(tower_energyet>maxet)
continue;
375 double w = tower_energyet;
379 w =
flat[
i]->
getW(tower_energyet, vzr_sell, bin);
381 if(tower_eta<0 ) w=-
w;
396 tower_eta = j->eta();
397 tower_phi = j->phi();
398 tower_energyet = j->et();
405 if(tower_energyet<minet)
continue;
406 if(tower_energyet>maxet)
continue;
407 double w = tower_energyet;
410 w =
flat[
i]->
getW(tower_energyet, vzr_sell, bin);
412 if(tower_eta<0 ) w=-
w;
426 double vzErr2 =0.0, vxyErr=0.0;
429 vtxPoint=
vertex_->begin()->position();
430 vzErr2= (
vertex_->begin()->zError())*(
vertex_->begin()->zError());
437 bool accepted =
true;
440 if ( j->numberOfValidHits() < 7 ) isPixel =
true;
443 double d0=0.0,
dz=0.0, d0sigma=0.0, dzsigma=0.0;
444 d0 = -1.*j->dxy(vtxPoint);
445 dz = j->dz(vtxPoint);
446 d0sigma =
sqrt(j->d0Error()*j->d0Error()+vxyErr);
447 dzsigma =
sqrt(j->dzError()*j->dzError()+vzErr2);
452 if ( fabs(
dz/dzsigma) >
dzerr_ ) accepted =
false;
454 if ( j->normalizedChi2() >
chi2_ ) accepted =
false;
459 if ( fabs(
dz/dzsigma) > 3 ) accepted =
false;
460 if ( fabs(d0/d0sigma) > 3 ) accepted =
false;
462 if ( j->ptError()/j->pt() > 0.1 ) accepted =
false;
464 if ( j->numberOfValidHits() < 12 ) accepted =
false;
467 track_eta = j->eta();
468 track_phi = j->phi();
475 if(track_pt<minpt)
continue;
476 if(track_pt>maxpt)
continue;
482 w =
flat[
i]->
getW(track_pt, vzr_sell, bin);
484 if(track_eta<0) w=-
w;
493 auto evtplaneOutput = std::make_unique<EvtPlaneCollection>();
508 rp[
i]->
getAngle(ang,sv,cv,svNoWgt, cvNoWgt, wv,wv2,pe,pe2,epmult);
509 evtplaneOutput->push_back(
EvtPlane(
i,0,ang,sv,cv,wv,wv2,pe,pe2,epmult) );
510 evtplaneOutput->back().addLevel(3, 0., svNoWgt, cvNoWgt);
void init(int order, int nbins, std::string tag, int vord)
edm::InputTag centralityBinTag_
std::string centralityLabel_
T getParameter(std::string const &) const
edm::Handle< CaloTowerCollection > caloCollection_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< CBin > m_table
common ppss p3p6s2 common epss epspn46 common const1 w2
edm::Handle< reco::TrackCollection > trackCollection_
std::string centralityMC_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::ESWatcher< HeavyIonRcd > hiWatcher
#define DEFINE_FWK_MODULE(type)
Sin< T >::type sin(const T &t)
std::vector< CaloTower >::const_iterator const_iterator
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void setCaloCentRefBins(const int caloCentRefMinBin, const int caloCentRefMaxBin)
std::vector< Vertex > VertexCollection
collection of Vertex objects
edm::EDGetTokenT< int > centralityBinToken
edm::EDGetTokenT< std::vector< reco::CastorTower > > castorToken
const std::string EPNames[]
const double maxTransverse[]
void produce(edm::Event &, const edm::EventSetup &) override
double getEtScale(double vtx, int centbin) const
edm::ESWatcher< HeavyIonRPRcd > hirpWatcher
const std::string MomConsWeight[]
GenPlane * rp[NumEPNames]
Cos< T >::type cos(const T &t)
HiEvtPlaneFlatten * flat[NumEPNames]
void addParticle(double w, double PtOrEt, double s, double c, double eta)
edm::EDGetTokenT< std::vector< reco::Vertex > > vertexToken
GenPlane(string name, double etaminval1, double etamaxval1, double etaminval2, double etamaxval2, int orderval)
EvtPlaneProducer(const edm::ParameterSet &)
edm::EDGetTokenT< reco::TrackCollection > trackToken
edm::Handle< std::vector< reco::CastorTower > > castorCollection_
bin
set the eta bin as selection string.
std::string centralityVariable_
double getW(double pt, double vtx, int centbin) const
T const * product() const
XYZPointD XYZPoint
point in space with cartesian internal representation
bool check(const edm::EventSetup &iSetup)
~EvtPlaneProducer() override
bool isPixel(HitType hitType)
static const int NumEPNames
edm::EDGetTokenT< CaloTowerCollection > caloToken
double getAngle(double &ang, double &sv, double &cv, double &svNoWgt, double &cvNoWgt, double &w, double &w2, double &PtOrEt, double &PtOrEt2, uint &epmult)
void reset(double vett[256])
edm::Handle< std::vector< reco::Vertex > > vertex_
const double minTransverse[]