Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running code-format for l1-upgrade #27347

Merged
merged 1 commit into from
Jun 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,37 @@
class EcalTPGWeightIdMap;
class EcalTPGWeightGroup;

/**
/**
\ class EcalFenixAmplitudeFilter
\brief calculates .... for Fenix strip, barrel
* input: 18 bits
* output: 18 bits
*
*/
class EcalFenixAmplitudeFilter {


private:
private:
int peakFlag_[5];
int inputsAlreadyIn_;
int buffer_[5];
int fgvbBuffer_[5];
int weights_[5];
int shift_;
int setInput(int input,int fgvb);
int setInput(int input, int fgvb);
void process();

int processedOutput_;
int processedFgvbOutput_;

public:
public:
EcalFenixAmplitudeFilter();
virtual ~EcalFenixAmplitudeFilter();
virtual void process(std::vector<int> & addout, std::vector<int> & output, std::vector<int> &fgvbIn, std::vector<int> &fgvbOut);
void setParameters(uint32_t raw,const EcalTPGWeightIdMap * ecaltpgWeightMap,const EcalTPGWeightGroup * ecaltpgWeightGroup);

virtual void process(std::vector<int> &addout,
std::vector<int> &output,
std::vector<int> &fgvbIn,
std::vector<int> &fgvbOut);
void setParameters(uint32_t raw,
const EcalTPGWeightIdMap *ecaltpgWeightMap,
const EcalTPGWeightGroup *ecaltpgWeightGroup);
};

#endif
92 changes: 45 additions & 47 deletions SimCalorimetry/EcalEBTrigPrimAlgos/interface/EcalFenixLinearizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,73 +6,71 @@
#include <CondFormats/EcalObjects/interface/EcalTPGLinearizationConst.h>
#include <CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h>

#include <vector>
#include <vector>

/**
/**
\class EcalFenixLinearizer
\brief Linearisation for Fenix strip
* input: 16 bits corresponding to input EBDataFrame
* output: 18 bits
*
*/

class EcalFenixLinearizer {


private:
bool famos_;
int uncorrectedSample_;
int gainID_;
int base_;
int mult_;
int shift_;
int strip_;
bool init_;
const EcalTPGLinearizationConstant *linConsts_;
const EcalTPGPedestal *peds_;
const EcalTPGCrystalStatusCode *badXStatus_;
std::vector<const EcalTPGCrystalStatusCode *> vectorbadXStatus_;
int setInput(const EcalMGPASample &RawSam) ;
int process() ;


public:
EcalFenixLinearizer(bool famos);
virtual ~EcalFenixLinearizer();

template <class T>
void process(const T &, std::vector<int>&);
void setParameters(uint32_t raw, const EcalTPGPedestals * ecaltpPed,const EcalTPGLinearizationConst * ecaltpLin, const EcalTPGCrystalStatus * ecaltpBadX) ;
class EcalFenixLinearizer {
private:
bool famos_;
int uncorrectedSample_;
int gainID_;
int base_;
int mult_;
int shift_;
int strip_;
bool init_;

const EcalTPGLinearizationConstant *linConsts_;
const EcalTPGPedestal *peds_;
const EcalTPGCrystalStatusCode *badXStatus_;

std::vector<const EcalTPGCrystalStatusCode *> vectorbadXStatus_;

int setInput(const EcalMGPASample &RawSam);
int process();

public:
EcalFenixLinearizer(bool famos);
virtual ~EcalFenixLinearizer();

template <class T>
void process(const T &, std::vector<int> &);
void setParameters(uint32_t raw,
const EcalTPGPedestals *ecaltpPed,
const EcalTPGLinearizationConst *ecaltpLin,
const EcalTPGCrystalStatus *ecaltpBadX);
};

template <class T>
void EcalFenixLinearizer::process(const T&df, std::vector<int> & output_percry)
{

template <class T>
void EcalFenixLinearizer::process(const T &df, std::vector<int> &output_percry) {
//We know a tower numbering is:
// S1 S2 S3 S4 S5
//
// 4 5 14 15 24
// 3 6 13 16 23
// 2 7 12 17 22
// 1 8 11 18 21
// 0 9 10 19 20
// S1 S2 S3 S4 S5
//
// 4 5 14 15 24
// 3 6 13 16 23
// 2 7 12 17 22
// 1 8 11 18 21
// 0 9 10 19 20

//std::cout << " EcalFenixLinearizer::process(const .. DataFrame " << std::endl;
for (int i=0;i<df.size();i++) {
for (int i = 0; i < df.size(); i++) {
//std::cout << df[i] << " ";
}

for (int i=0;i<df.size();i++) {
for (int i = 0; i < df.size(); i++) {
setInput(df[i]);
output_percry[i]=process();
output_percry[i] = process();
}

//std::cout << " EcalFenixLinearizer::process(const .. Final output " << std::endl;
for (int i=0;i<df.size();i++) {
for (int i = 0; i < df.size(); i++) {
//std::cout << " output_percry " << output_percry[i]<< " ";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <vector>

/**
/**
\ class EcalFenixPeakFinder
\brief calculates the peak for Fenix strip, barrel
* input : 18 bits
Expand All @@ -14,23 +14,21 @@
*/

class EcalFenixPeakFinder {

private:
private:
bool disabled;
int setInput(int input);
int process();

int inputsAlreadyIn_;
int buffer_[3];

public:

public:
EcalFenixPeakFinder();
virtual ~EcalFenixPeakFinder();
virtual std::vector<int> process(std::vector<int>& filtout, std::vector<int> & output);
virtual std::vector<int> process(std::vector<int>& filtout, std::vector<int>& output);
// from CaloVShape
// virtual double operator()(double) const {return 0.;}
// virtual double derivative(double) const {return 0.;}
};
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@

class EcalTPGSlidingWindow;

/**
/**
\class EcalFenixStripFormatEB
\brief Formatting for Fenix strip
* input: 18 bits + 3x 1bit (fgvb, gapflagbit, output from peakfinder)
* output:16 bits
* The output corresponds to 1 calodataframe per strip
* --- not really a calodataframe no?
*/


class EcalFenixStripFormatEB {

private:
class EcalFenixStripFormatEB {
private:
int inputsFGVB_;
int inputPeak_;
int input_;
Expand All @@ -28,10 +26,10 @@ class EcalTPGSlidingWindow;
int setInput(int input, int inputPeak, int inputsFGVB);
int process();

public:
public:
EcalFenixStripFormatEB();
virtual ~EcalFenixStripFormatEB();
virtual void process(std::vector<int> &, std::vector<int> &, std::vector<int> &, std::vector<int> &) ;
void setParameters(uint32_t&, const EcalTPGSlidingWindow*&);
virtual void process(std::vector<int> &, std::vector<int> &, std::vector<int> &, std::vector<int> &);
void setParameters(uint32_t &, const EcalTPGSlidingWindow *&);
};
#endif
31 changes: 20 additions & 11 deletions SimCalorimetry/EcalEBTrigPrimAlgos/interface/EcalFenixTcpFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "DataFormats/EcalDigi/interface/EcalEBTriggerPrimitiveSample.h"
#include <vector>

class EcalTPGLutGroup ;
class EcalTPGLutGroup;
class EcalTPGLutIdMap;
class EcalTPGTowerStatus;
class EcalTPGSpike;
Expand All @@ -19,19 +19,28 @@ class EcalTPGSpike;
* simple formatting
*
*/
class EcalFenixTcpFormat {

public:
EcalFenixTcpFormat(bool tccFormat, bool debug, bool famos, int binOfMax);
class EcalFenixTcpFormat {
public:
EcalFenixTcpFormat(bool tccFormat, bool debug, bool famos, int binOfMax);
virtual ~EcalFenixTcpFormat();

void process(std::vector<int>&,std::vector<int>&);
void process(std::vector<int> &Et, std::vector<int> &fgvb, std::vector<int> &sfgvb, int eTTotShift, std::vector<EcalEBTriggerPrimitiveSample> & out, std::vector<EcalEBTriggerPrimitiveSample> & outTcc, bool isInInnerRings) ;
void setParameters(uint32_t towid,const EcalTPGLutGroup *ecaltpgLutGroup,const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGTowerStatus *ecaltpgbadTT, const EcalTPGSpike * ecaltpgSpike);
void process(std::vector<int> &, std::vector<int> &);
void process(std::vector<int> &Et,
std::vector<int> &fgvb,
std::vector<int> &sfgvb,
int eTTotShift,
std::vector<EcalEBTriggerPrimitiveSample> &out,
std::vector<EcalEBTriggerPrimitiveSample> &outTcc,
bool isInInnerRings);
void setParameters(uint32_t towid,
const EcalTPGLutGroup *ecaltpgLutGroup,
const EcalTPGLutIdMap *ecaltpgLut,
const EcalTPGTowerStatus *ecaltpgbadTT,
const EcalTPGSpike *ecaltpgSpike);

private:
const unsigned int * lut_ ;
const uint16_t * badTTStatus_;
private:
const unsigned int *lut_;
const uint16_t *badTTStatus_;
uint16_t status_;
bool tcpFormat_;
bool debug_;
Expand Down