Skip to content

Commit

Permalink
[+] back port EP code cms-sw#9022 to 74X
Browse files Browse the repository at this point in the history
  • Loading branch information
BetterWang committed Jun 1, 2015
1 parent ad2afd0 commit 9b31b25
Show file tree
Hide file tree
Showing 20 changed files with 1,290 additions and 1,421 deletions.
71 changes: 41 additions & 30 deletions DataFormats/HeavyIonEvent/interface/EvtPlane.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

//
// Levels:
//
// 0 Neither recentering nor flattening is done. The final weights are applied.
// 1 The sums over the sines and cosines are recentered.
// 2 Final results including both recentering and flattening. Default if the level is not specified.
// 3 Calculation where all weights are set to unity.
//
//

Expand All @@ -7,37 +14,41 @@

#include <vector>
#include <string>
#include <cmath>

namespace reco { class EvtPlane {
public:
EvtPlane(double planeA=0,double sumSin=0, double sumCos=0, std::string label="");
virtual ~EvtPlane();

double angle() const { return angle_; }
double sumSin() const { return sumSin_;}
double sumCos() const { return sumCos_;}
std::string label() const { return label_; }



private:

double angle_ ;
double sumSin_;
double sumCos_;
std::string label_;


};

typedef std::vector<EvtPlane> EvtPlaneCollection;

public:
EvtPlane(int epindx=0, int level = 2, double planeA=0,double sumSin=0, double sumCos=0, double sumw = 0, double sumw2 = 0, double pe = 0, double pe2 = 0, uint mult = 0);
virtual ~EvtPlane();
void addLevel(int level, double ang, double sumsin, double sumcos);
int indx() const { return indx_ ;}
float angle(int level=2) const { return (level>=0&&level<4)? angle_[level]:angle_[2]; }
float sumSin(int level=2) const { return (level>=0&&level<4)? sumSin_[level]:sumSin_[2];}
float sumCos(int level=2) const { return (level>=0&&level<4)? sumCos_[level]:sumCos_[2];}
float sumw() const { return sumw_;}
float sumw2() const { return sumw2_;}
float sumPtOrEt() const { return sumPtOrEt_;}
float sumPtOrEt2() const { return sumPtOrEt2_;}
float mult() const { return mult_;}
float qy(int level=2) const { return sumSin(level); }
float qx(int level=2) const { return sumCos(level); }
float q(int level=2) const { return ((pow(qx(level),2)+pow(qy(level),2))>0)? sqrt(pow(qx(level),2)+pow(qy(level),2)): 0.;}
float vn(int level=2) const{ return (q(level)>0 && fabs(sumw())>0)? q(level)/fabs(sumw()): 0.;}

private:
int indx_;
float angle_[4];
float sumSin_[4];
float sumCos_[4];
float sumw_;
float sumw2_;
float sumPtOrEt_;
float sumPtOrEt2_;
uint mult_;

};

typedef std::vector<EvtPlane> EvtPlaneCollection;
}

#endif






#endif
52 changes: 19 additions & 33 deletions DataFormats/HeavyIonEvent/src/EvtPlane.cc
Original file line number Diff line number Diff line change
@@ -1,43 +1,29 @@
// //
// //
//
// #include "DataFormats/HeavyIonEvent/interface/EvtPlane.h"
//
// using namespace reco;
//
// EvtPlane::EvtPlane(double planeA, std::string label)
// :
// angle_(planeA),
// label_(label)
// {
// // default constructor
// }
//
//
// EvtPlane::~EvtPlane()
// {
// }
//
//


//
//

#include "DataFormats/HeavyIonEvent/interface/EvtPlane.h"

using namespace reco;

EvtPlane::EvtPlane(double planeA,double sumSin, double sumCos, std::string label)
using namespace std;
EvtPlane::EvtPlane(int epindx, int level, double planeA,double sumSin, double sumCos, double sumw, double sumw2, double sumPtOrEt, double sumPtOrEt2, uint mult)
:
angle_(planeA),
sumSin_(sumSin),
sumCos_(sumCos),
label_(label)
indx_(epindx),
sumw_(sumw),
sumw2_(sumw2),
sumPtOrEt_(sumPtOrEt),
sumPtOrEt2_(sumPtOrEt2),
mult_(mult)
{
for ( int i = 0; i < 4; ++i ) {
angle_[i] = sumSin_[i] = sumCos_[i] = -10;
}
angle_[level] = planeA;
sumSin_[level] = sumSin;
sumCos_[level] = sumCos;
// default constructor
}

void EvtPlane::addLevel(int level, double ang, double sumsin, double sumcos) {
angle_[level] = ang;
sumSin_[level] = sumsin;
sumCos_[level] = sumcos;
}

EvtPlane::~EvtPlane()
{
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/HeavyIonEvent/src/classes_def.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<lcgdict>
<class name="reco::EvtPlane" ClassVersion="10">
<version ClassVersion="10" checksum="3204318766"/>
<class name="reco::EvtPlane" ClassVersion="11">
<version ClassVersion="11" checksum="393681411"/>
</class>
<class name="edm::Wrapper<reco::EvtPlane>"/>
<class name="reco::Centrality" ClassVersion="10">
Expand Down
Loading

0 comments on commit 9b31b25

Please sign in to comment.