Skip to content

Commit

Permalink
modify the EcalTriggerPrimitiveDigi format to use the xstal ID instea…
Browse files Browse the repository at this point in the history
…d of tower id
  • Loading branch information
nancymarinelli authored and cmsbuild committed Nov 24, 2016
1 parent 36cb014 commit d3e703d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 deletions.
19 changes: 12 additions & 7 deletions DataFormats/EcalDigi/interface/EcalTriggerPrimitiveDigi.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

#include <ostream>
#include <vector>
#include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h"
#include "DataFormats/EcalDetId/interface/EBDetId.h"
//#include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h"
#include "DataFormats/EcalDigi/interface/EcalTriggerPrimitiveSample.h"


Expand All @@ -16,10 +17,12 @@ see also EcalTrigPrimCompactColl.

class EcalTriggerPrimitiveDigi {
public:
typedef EcalTrigTowerDetId key_type; ///< For the sorted collection
//typedef EcalTrigTowerDetId key_type; ///< For the sorted collection
typedef EBDetId key_type; ///< For the sorted collection

EcalTriggerPrimitiveDigi(); // for persistence
explicit EcalTriggerPrimitiveDigi(const EcalTrigTowerDetId& id);
// explicit EcalTriggerPrimitiveDigi(const EcalTrigTowerDetId& id);
EcalTriggerPrimitiveDigi(const EBDetId& id);


void swap(EcalTriggerPrimitiveDigi& rh) {
Expand All @@ -28,14 +31,16 @@ class EcalTriggerPrimitiveDigi {
std::swap(data_,rh.data_);
}

const EcalTrigTowerDetId& id() const { return id_; }
const EBDetId& id() const { return id_; }
//const EcalTrigTowerDetId& id() const { return id_; }
int size() const { return size_; }

const EcalTriggerPrimitiveSample& operator[](int i) const { return data_[i]; }
const EcalTriggerPrimitiveSample& sample(int i) const { return data_[i]; }

void setSize(int size);
void setSample(int i, const EcalTriggerPrimitiveSample& sam) { data_[i]=sam; }
// void setSample(int i, const EcalTriggerPrimitiveSample& sam) {cout << " Fuck you " << endl; data_[i]=sam; }
void setSample(int i, const EcalTriggerPrimitiveSample& sam);
void setSampleValue(int i, uint16_t value) { data_[i].setValue(value); }

static const int MAXSAMPLES = 20;
Expand Down Expand Up @@ -68,8 +73,8 @@ class EcalTriggerPrimitiveDigi {
int sampleOfInterest() const;

private:

EcalTrigTowerDetId id_;
EBDetId id_;
//EcalTrigTowerDetId id_;
int size_;
std::vector<EcalTriggerPrimitiveSample> data_;
};
Expand Down
16 changes: 14 additions & 2 deletions DataFormats/EcalDigi/src/EcalTriggerPrimitiveDigi.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
#include "DataFormats/EcalDigi/interface/EcalTriggerPrimitiveDigi.h"

#include <iostream>


EcalTriggerPrimitiveDigi::EcalTriggerPrimitiveDigi() : size_(0), data_(MAXSAMPLES) {
}
EcalTriggerPrimitiveDigi::EcalTriggerPrimitiveDigi(const EcalTrigTowerDetId& id) : id_(id),
//EcalTriggerPrimitiveDigi::EcalTriggerPrimitiveDigi(const EcalTrigTowerDetId& id) : id_(id),
//size_(0), data_(MAXSAMPLES) {
//}

EcalTriggerPrimitiveDigi::EcalTriggerPrimitiveDigi(const EBDetId& id) : id_(id),
size_(0), data_(MAXSAMPLES) {
}

void EcalTriggerPrimitiveDigi::setSample(int i, const EcalTriggerPrimitiveSample& sam)
{
// std::cout << " In setSample i " << i << " sam " << sam << std::endl;
data_[i]=sam;
// std::cout << " In setSample data_[i] " << data_[i] << std::endl;

}

int EcalTriggerPrimitiveDigi::sampleOfInterest() const
{
if (size_ == 1)
Expand Down
13 changes: 3 additions & 10 deletions DataFormats/EcalDigi/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
<class name="EcalTriggerPrimitiveSample" ClassVersion="10">
<version ClassVersion="10" checksum="251958438"/>
</class>
<class name="EcalTriggerPrimitiveDigi" ClassVersion="10">
<version ClassVersion="10" checksum="3058718200"/>
<class name="EcalTriggerPrimitiveDigi" ClassVersion="12">
<version ClassVersion="12" checksum="1614412819"/>
</class>

<class name="EcalPseudoStripInputSample" ClassVersion="10">
<version ClassVersion="10" checksum="2913557465"/>
</class>
Expand All @@ -44,14 +45,9 @@
<version ClassVersion="11" checksum="515819338"/>
<version ClassVersion="10" checksum="804498184"/>
</class>
<class name="EcalTimeDigi" ClassVersion="3">
<version ClassVersion="3" checksum="3095247500"/>
</class>

<class name="std::vector<EcalMGPASample>"/>
<class name="std::vector<EcalFEMSample>"/>
<class name="std::vector<ESSample>"/>
<class name="std::vector<float>"/>
<class name="std::vector<EcalTriggerPrimitiveSample>"/>
<class name="std::vector<EcalPseudoStripInputSample>"/>
<class name="std::vector<ESDataFrame>"/>
Expand All @@ -61,7 +57,6 @@
<class name="std::vector<EcalPseudoStripInputDigi>"/>
<class name="std::vector<EcalPnDiodeDigi>"/>
<class name="std::vector<EcalMatacqDigi>"/>
<class name="std::vector<EcalTimeDigi>"/>

<class name="EcalDigiCollection" ClassVersion="11">
<version ClassVersion="11" checksum="3935588643"/>
Expand Down Expand Up @@ -89,7 +84,6 @@
<class name="edm::Wrapper<EcalTrigPrimCompactColl>" splitLevel="0"/>

<class name="edm::SortedCollection<ESDataFrame,edm::StrictWeakOrdering<ESDataFrame> >"/>
<class name="edm::SortedCollection<EcalTimeDigi,edm::StrictWeakOrdering<EcalTimeDigi> >"/>
<class name="edm::SortedCollection<EcalTriggerPrimitiveDigi,edm::StrictWeakOrdering<EcalTriggerPrimitiveDigi> >"/>
<class name="edm::StrictWeakOrdering<EcalTriggerPrimitiveDigi>" /> <!-- Root6 -->
<class name="edm::SortedCollection<EcalPseudoStripInputDigi,edm::StrictWeakOrdering<EcalPseudoStripInputDigi> >"/>
Expand All @@ -104,7 +98,6 @@
<class name="edm::Wrapper<edm::SortedCollection<ESDataFrame,edm::StrictWeakOrdering<ESDataFrame> > >" splitLevel="0" id="C3D41492-2914-2291-7C22-BBE6D77043F7"/>
<class name="edm::Wrapper<edm::SortedCollection<EcalTriggerPrimitiveDigi,edm::StrictWeakOrdering<EcalTriggerPrimitiveDigi> > >" splitLevel="0" id="D932A444-CBDD-A27C-4D85-BFED25EFBCF8"/>
<class name="edm::Wrapper<edm::SortedCollection<EcalPseudoStripInputDigi,edm::StrictWeakOrdering<EcalPseudoStripInputDigi> > >" splitLevel="0" id=""/>
<class name="edm::Wrapper<edm::SortedCollection<EcalTimeDigi,edm::StrictWeakOrdering<EcalTimeDigi> > >" splitLevel="0" id=""/>
<class name="edm::Wrapper<edm::SortedCollection<EBSrFlag,edm::StrictWeakOrdering<EBSrFlag> > >" splitLevel="0" id="C0D3A113-A36C-40F1-A388-28ECE47DCBA5"/>
<class name="edm::Wrapper<edm::SortedCollection<EESrFlag,edm::StrictWeakOrdering<EESrFlag> > >" splitLevel="0" id="CE18D35E-E4F5-4685-8D9A-213D9ACB0606"/>
<class name="edm::Wrapper<edm::SortedCollection<EcalPnDiodeDigi,edm::StrictWeakOrdering<EcalPnDiodeDigi> > >" id="8104DEE4-28BC-284A-8397-7EF8F5DBA1B1"/>
Expand Down

0 comments on commit d3e703d

Please sign in to comment.