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

Updates in HGCAL L1 trigger #14831

Merged
merged 51 commits into from
Aug 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
a88350f
linearisation
baffioni May 2, 2016
4bf0ace
linearisation
baffioni May 2, 2016
563e314
linearisation
baffioni May 2, 2016
aeb3054
linearisation
baffioni May 2, 2016
4287770
linearisation
baffioni May 2, 2016
409eecd
linearized frames as input to trigger sum
baffioni May 4, 2016
802d837
linearized frames as input to trigger sum + editing spaces
baffioni May 4, 2016
7c1af61
linearized frames as input to trigger sum
baffioni May 4, 2016
4c53763
linearized frames as input to trigger sum + editing spaces
baffioni May 4, 2016
40206df
parameters taken from digitization
baffioni May 9, 2016
6d7d1f3
Removing tabs
jbsauvan May 10, 2016
5b663f7
Merge pull request #1 from jbsauvan/baffioni-linearisation-810pre3
baffioni May 10, 2016
8608223
updates for 810_pre3
baffioni May 11, 2016
b4bec74
Merge branch 'baffioni-linearisation-810pre3' of https://github.com/b…
baffioni May 11, 2016
14b2e91
cleaning details
baffioni May 12, 2016
8a3db57
cleaning details
baffioni May 12, 2016
03f93c8
cleaning details
baffioni May 12, 2016
72f8909
Merge pull request #31 from baffioni/baffioni-linearisation-810pre3
jbsauvan May 12, 2016
30cf5a3
Add hex trigger geometry
jbsauvan May 9, 2016
09c841d
Fixed and cleaning of the HGC trigger geometry
jbsauvan May 12, 2016
4576164
Add HGC trigger cell and module mappings
jbsauvan May 12, 2016
1a01631
Add test drawing scripts for the HGC trigger hex geometry
jbsauvan May 12, 2016
8b0e83f
Compatibility updates for the hex geometry
jbsauvan May 12, 2016
ef48069
Update hgc tpg test config
jbsauvan May 12, 2016
a573fee
Merge pull request #32 from jbsauvan/hgc-tpg-hex-geom
jbsauvan May 15, 2016
1986abd
Add producer using HGC FEDigis as input
jbsauvan May 26, 2016
5dfd6e7
Add input FE digi decoding using alternative parameters in HGCalBestC…
jbsauvan May 26, 2016
a6d58a7
Add const to decoded digi
jbsauvan May 27, 2016
d73b672
Fix parameters in best choice unit test
jbsauvan May 27, 2016
74190ce
Add single trigger cell clustering algo
jbsauvan Jun 1, 2016
e9f4c20
Add parameter for trigger cell value truncation. Update best choice t…
jbsauvan Jun 2, 2016
3d3a78f
Reduce maximum number of trigger cells per module
jbsauvan Jun 2, 2016
86b636c
Fix test config
jbsauvan Jun 2, 2016
3ef4097
Merge pull request #33 from jbsauvan/hgc-tpg-fe-structure-update
jbsauvan Jun 4, 2016
1c5197c
Add module definition in FH
jbsauvan Jun 6, 2016
bed599c
Add FHE in best choice selection
jbsauvan Jun 6, 2016
0202815
Update geometry tester with FH
jbsauvan Jun 7, 2016
d516b29
Fix FH trigger geometry and update test script
jbsauvan Jun 7, 2016
cbb5c04
Add test config to run on already produced HFCFETriggerDigi
jbsauvan Jun 7, 2016
51972c5
Fix E -> ET conversion
jbsauvan Jun 8, 2016
36e81f8
Shorten data frame emplace_back
jbsauvan Jun 8, 2016
3ecf755
Use ForwardDetId instead of int
jbsauvan Jun 8, 2016
994a290
Update best choice unit test
jbsauvan Jun 8, 2016
429c9ad
Merge pull request #34 from jbsauvan/hgc-tpg-add-fhe
jbsauvan Jun 8, 2016
8ceca78
Merged hgc-tpg-devel-CMSSW_8_1_0_pre3 from repository PFCal-dev
jbsauvan Jun 8, 2016
da90dc0
Update geometry config for pre6 and temporarily remove unused BH
jbsauvan Jun 9, 2016
a1a1ff7
Change auto_ptr to unique_ptr
jbsauvan Jun 9, 2016
3b166c6
Update member name in BE algos
jbsauvan Jun 9, 2016
af03ea3
Merged hgc-tpg-devel-CMSSW_8_1_0_pre6 from repository PFCal-dev
jbsauvan Jun 9, 2016
7951e28
Remove data files for integration
jbsauvan Jun 9, 2016
9506526
Move stringstream outside loop and reserve vector
jbsauvan Jun 25, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 23 additions & 50 deletions DataFormats/L1THGCal/interface/HGCalCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,6 @@
namespace l1t {

class HGCalCluster : public L1Candidate {
public:
// FIXME: remnants of Stage-2 calo trigger to be removed
enum ClusterFlag{
INCLUDE_SEED = 0,
INCLUDE_NW = 1,
INCLUDE_N = 2,
INCLUDE_NE = 3,
INCLUDE_E = 4,
INCLUDE_SE = 5,
INCLUDE_S = 6,
INCLUDE_SW = 7,
INCLUDE_W = 8,
INCLUDE_NN = 9,
INCLUDE_SS = 10,
TRIM_LEFT = 11,
IS_SECONDARY = 12,
MERGE_UPDOWN = 13, // 0=up, 1=down
MERGE_LEFTRIGHT = 14 // 0=left, 1=right
};

public:
HGCalCluster(){}
HGCalCluster( const LorentzVector p4,
Expand All @@ -37,50 +17,43 @@ namespace l1t {

~HGCalCluster();

void setHwPtEm (uint32_t pt) {hwPtEm_= pt;}
void setHwPtHad (uint32_t pt) {hwPtHad_ = pt;}
void setHwSeedPt(uint32_t pt) {hwSeedPt_ = pt;}
void setSubDet (uint32_t subdet){subDet_ = subdet;}
void setLayer (uint32_t layer) {layer_ = layer;}
void setModule (uint32_t module) {module_ = module;}
void setHOverE (uint32_t hOverE){hOverE_ = hOverE;}

bool isValid() const {return true;}
uint32_t hwPtEm() const {return hwPtEm_;}
uint32_t hwPtHad() const {return hwPtHad_;}
uint32_t hwSeedPt() const {return hwSeedPt_;}

uint32_t subDet() const {return subDet_;}
uint32_t layer() const {return layer_;}
uint32_t module() const {return module_;}

void setClusterFlag(ClusterFlag flag, bool val=true);
void setHwPtEm( int pt );
void setHwPtHad( int pt );
void setHwSeedPt(int pt);
void setFgEta(int fgEta);
void setFgPhi(int fgPhi);
void setHOverE(int hOverE);
void setFgECAL(int fgECAL);

bool checkClusterFlag(ClusterFlag flag) const;
bool isValid() const;
int hwPtEm() const;
int hwPtHad() const;
int hwSeedPt() const;
int fgEta() const;
int fgPhi() const;
int hOverE() const;
int fgECAL() const;
int clusterFlags() const{return m_clusterFlags;}
uint32_t hOverE() const {return hOverE_;}

bool operator<(const HGCalCluster& cl) const;
bool operator>(const HGCalCluster& cl) const {return cl<*this;};
bool operator<=(const HGCalCluster& cl) const {return !(cl>*this);};
bool operator>=(const HGCalCluster& cl) const {return !(cl<*this);};

private:
// Summary of clustering outcomes
int m_clusterFlags; // see ClusterFlag bits (15 bits, will evolve)

// Energies
int m_hwPtEm;
int m_hwPtHad;
int m_hwSeedPt;
uint32_t hwPtEm_;
uint32_t hwPtHad_;
uint32_t hwSeedPt_;

// fine grained position
int m_fgEta; // 2 bits (to be defined in agreement with GT inputs)
int m_fgPhi; // 2 bits (to be defined in agreement with GT inputs)
// HGC specific information
uint32_t subDet_;
uint32_t layer_;
uint32_t module_;

// identification variables
int m_hOverE; // 8 bits (between 0 and 1 -> resolution=1/256=0.39%). Number of bits is not definitive
int m_fgECAL; // FG bit of the seed tower
uint32_t hOverE_;
};

typedef BXVector<HGCalCluster> HGCalClusterBxCollection;
Expand Down
95 changes: 1 addition & 94 deletions DataFormats/L1THGCal/src/HGCalCluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ HGCalCluster::HGCalCluster( const LorentzVector p4,
int pt,
int eta,
int phi)
: L1Candidate(p4, pt, eta, phi),
m_clusterFlags(0x7FF) // first 11 flags at 1
: L1Candidate(p4, pt, eta, phi)
{

}
Expand All @@ -17,98 +16,6 @@ HGCalCluster::~HGCalCluster()

}

void HGCalCluster::setClusterFlag(ClusterFlag flag, bool val)
{
if(val)
{
m_clusterFlags |= (0x1<<flag);
}
else
{
m_clusterFlags &= ~(0x1<<flag);
}
};

void HGCalCluster::setHwPtEm(int pt)
{
m_hwPtEm = pt;
}

void HGCalCluster::setHwPtHad(int pt)
{
m_hwPtHad = pt;
}

void HGCalCluster::setHwSeedPt(int pt)
{
m_hwSeedPt = pt;
}

void HGCalCluster::setFgEta(int fgEta)
{
m_fgEta = fgEta;
}

void HGCalCluster::setFgPhi(int fgPhi)
{
m_fgPhi = fgPhi;
}

void HGCalCluster::setHOverE(int hOverE)
{
m_hOverE = hOverE;
}

void HGCalCluster::setFgECAL(int fgECAL)
{
m_fgECAL = fgECAL;
}

bool HGCalCluster::checkClusterFlag(ClusterFlag flag) const
{
return (m_clusterFlags & (0x1<<flag));
};

bool HGCalCluster::isValid() const
{
return ( checkClusterFlag(INCLUDE_SEED) );
}

int HGCalCluster::hwPtEm()const
{
return m_hwPtEm;
}

int HGCalCluster::hwPtHad()const
{
return m_hwPtHad;
}

int HGCalCluster::hwSeedPt() const
{
return m_hwSeedPt;
}

int HGCalCluster::fgEta() const
{
return m_fgEta;
}

int HGCalCluster::fgPhi() const
{
return m_fgPhi;
}

int HGCalCluster::hOverE() const
{
return m_hOverE;
}

int HGCalCluster::fgECAL() const
{
return m_fgECAL;
}

bool HGCalCluster::operator<(const HGCalCluster& cl) const
{
bool res = false;
Expand Down
17 changes: 15 additions & 2 deletions L1Trigger/L1THGCal/interface/HGCalTriggerFECodecBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ class HGCalTriggerFECodecBase {
const HGCEEDigiCollection&,
const HGCHEDigiCollection&,
const HGCHEDigiCollection& ) = 0;
virtual void setDataPayload(const Module& ,
const l1t::HGCFETriggerDigi&) = 0;
virtual void unSetDataPayload() = 0;
// get the set data out for your own enjoyment
virtual std::vector<bool> getDataPayload() const = 0;

// abstract interface to manipulating l1t::HGCFETriggerDigis
// these will yell at you if you haven't set the data in the Codec class
virtual void encode(l1t::HGCFETriggerDigi&) = 0;
virtual void decode(l1t::HGCFETriggerDigi&) = 0;
virtual void decode(const l1t::HGCFETriggerDigi&) = 0;
virtual void print(const l1t::HGCFETriggerDigi& digi,
std::ostream& out = std::cout) const = 0;

Expand Down Expand Up @@ -80,7 +82,7 @@ namespace HGCalTriggerFE {
}
digi.encode(static_cast<const Impl&>(*this),data_);
}
virtual void decode(l1t::HGCFETriggerDigi& digi) override final {
virtual void decode(const l1t::HGCFETriggerDigi& digi) override final {
if( dataIsSet_ ) {
edm::LogWarning("HGCalTriggerFECodec|OverwritePayload")
<< "Data payload was already set for HGCTriggerFECodec: "
Expand All @@ -103,6 +105,17 @@ namespace HGCalTriggerFE {
dataIsSet_ = true;
}

virtual void setDataPayload(const Module& mod,
const l1t::HGCFETriggerDigi& digi) override final {
if( dataIsSet_ ) {
edm::LogWarning("HGCalTriggerFECodec|OverwritePayload")
<< "Data payload was already set for HGCTriggerFECodec: "
<< this->name() << " overwriting current data!";
}
static_cast<Impl&>(*this).setDataPayloadImpl(mod,digi);
dataIsSet_ = true;
}

virtual void unSetDataPayload() override final {
data_.reset();
dataIsSet_ = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class HGCal64BitRandomCodec : public HGCalTriggerFE::Codec<HGCal64BitRandomCodec
const HGCEEDigiCollection& ee,
const HGCHEDigiCollection& fh,
const HGCHEDigiCollection& bh );

void setDataPayloadImpl(const Module& mod,
const l1t::HGCFETriggerDigi& digi);

std::vector<bool> encodeImpl(const data_type&) const ;
data_type decodeImpl(const std::vector<bool>&) const;
Expand Down
3 changes: 3 additions & 0 deletions L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class HGCalBestChoiceCodec : public HGCalTriggerFE::Codec<HGCalBestChoiceCodec,H
const HGCHEDigiCollection& fh,
const HGCHEDigiCollection& bh );

void setDataPayloadImpl(const Module& mod,
const l1t::HGCFETriggerDigi& digi);

std::vector<bool> encodeImpl(const data_type&) const ;
data_type decodeImpl(const std::vector<bool>&) const;

Expand Down
41 changes: 35 additions & 6 deletions L1Trigger/L1THGCal/interface/fe_codecs/HGCalBestChoiceCodecImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

struct HGCalBestChoiceDataPayload
{
static const size_t size = 64;
typedef std::array<uint32_t, size> trigger_cell_list; // list of data in 64 trigger cells
static const size_t size = 114;
typedef std::array<uint32_t, size> trigger_cell_list; // list of trigger cell values
trigger_cell_list payload;

void reset()
Expand All @@ -34,13 +34,42 @@ class HGCalBestChoiceCodecImpl
std::vector<bool> encode(const data_type&) const ;
data_type decode(const std::vector<bool>&) const;

void triggerCellSums(const HGCalTriggerGeometry::Module& , const std::vector<HGCEEDataFrame>&, data_type&);
void linearize(const HGCalTriggerGeometry::Module& ,
const std::vector<HGCDataFrame<HGCalDetId,HGCSample>>&,
std::vector<std::pair<HGCalDetId, uint32_t > >&);

void triggerCellSums(const HGCalTriggerGeometry::Module& ,
const std::vector<std::pair<HGCalDetId, uint32_t > >&,
data_type&);
void bestChoiceSelect(data_type&);

// Retrieve parameters
size_t nData() const {return nData_;}
size_t dataLength() const {return dataLength_;}
double linLSB() const {return linLSB_;}
double adcsaturation() const {return adcsaturation_;}
uint32_t adcnBits() const {return adcnBits_;}
double tdcsaturation() const {return tdcsaturation_;}
uint32_t tdcnBits() const {return tdcnBits_;}
double tdcOnsetfC() const {return tdcOnsetfC_;}
uint32_t triggerCellTruncationBits() const {return triggerCellTruncationBits_;}
uint32_t triggerCellSaturationBits() const {return triggerCellSaturationBits_;}


private:
size_t nData_;
size_t dataLength_;
size_t nCellsInModule_;
size_t nData_;
size_t dataLength_;
size_t nCellsInModule_;
double linLSB_;
double adcsaturation_;
uint32_t adcnBits_;
double tdcsaturation_ ;
uint32_t tdcnBits_ ;
double tdcOnsetfC_ ;
double adcLSB_;
double tdcLSB_;
uint32_t triggerCellTruncationBits_;
uint32_t triggerCellSaturationBits_;

};

Expand Down
Loading