-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Rpc digi dev v9 #47447
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
base: master
Are you sure you want to change the base?
Rpc digi dev v9 #47447
Changes from all commits
b8bfdc2
d9d1b40
765f64d
3220cde
e4371f5
d0fee5c
933d237
a251a7e
4a3b827
c807ee4
7e20f66
9da6842
08fce7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import FWCore.ParameterSet.Config as cms | ||
|
|
||
| phase2_rpc_devel = cms.Modifier() | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #ifndef IRPCDigi_IRPCDigi_h | ||
| #define IRPCDigi_IRPCDigi_h | ||
|
|
||
| /** \class IRPCDigi | ||
| * | ||
| * Digi for Improved Resisitive Plate Chamber (IRPC) | ||
| * | ||
| * \author Borislav Pavlov - University of Sofia | ||
| */ | ||
|
|
||
| #include <cstdint> | ||
| #include <iosfwd> | ||
|
|
||
| class IRPCDigi { | ||
| public: | ||
| explicit IRPCDigi(int strip, int bxLR, int bxHR, int sbxLR, int sbxHR, int fineLR, int fineHR); | ||
| IRPCDigi(); | ||
|
|
||
| bool operator==(const IRPCDigi& digi) const; | ||
| bool operator<(const IRPCDigi& digi) const; | ||
| void print() const; | ||
| int strip() const { return strip_; } | ||
| int bx() const { return bxLR_; } | ||
| int sbx() const { return sbxLR_; } | ||
| int bxLR() const { return bxLR_; } | ||
| int bxHR() const { return bxHR_; } | ||
| int sbxLR() const { return sbxLR_; } | ||
| int sbxHR() const { return sbxHR_; } | ||
| int fineLR() const { return fineLR_; } | ||
| int fineHR() const { return fineHR_; } | ||
|
|
||
| private: | ||
| uint16_t strip_; | ||
| int32_t bxLR_; //BX from low radius FEB | ||
| int32_t bxHR_; //BX from high radius FEB | ||
| int8_t sbxLR_; //sub-BX from low radius FEB | ||
| int8_t sbxHR_; //sub-BX from high radius FEB | ||
| int8_t fineLR_; //high resolution time rom low radius FEB | ||
| int8_t fineHR_; //high resolution time rom high radius FEB | ||
| }; | ||
|
|
||
| std::ostream& operator<<(std::ostream& o, const IRPCDigi& digi); | ||
|
|
||
| #endif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #ifndef IRPCDigi_IRPCDigiCollection_h | ||
| #define IRPCDigi_IRPCDigiCollection_h | ||
| /** \class RPCDigiCollection | ||
| * | ||
| * \author Borislav Pavlov | ||
| * \date 14 July 2021 | ||
| */ | ||
|
|
||
| #include <DataFormats/MuonDetId/interface/RPCDetId.h> | ||
| #include <DataFormats/RPCDigi/interface/IRPCDigi.h> | ||
| #include <DataFormats/MuonData/interface/MuonDigiCollection.h> | ||
|
|
||
| typedef MuonDigiCollection<RPCDetId, IRPCDigi> IRPCDigiCollection; | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #include "DataFormats/RPCDigi/interface/IRPCDigi.h" | ||
|
|
||
| class IRPCDigiTime { | ||
| public: | ||
| IRPCDigiTime(const IRPCDigi& adigi); | ||
| float time(); | ||
| float coordinateY(); | ||
| float timeLR(); | ||
| float timeHR(); | ||
|
|
||
| private: | ||
| IRPCDigi theDigi; | ||
| float TDC2Time(int BX, int SBX, int FT); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| #ifndef RPCDigi_RPCDigiPhase2_h | ||
| #define RPCDigi_RPCDigiPhase2_h | ||
|
|
||
| /** \class RPCDigiPhase2 | ||
| * | ||
| * Digi for Resisitive Plate Chamber, after Phase2 upgrade | ||
| * | ||
| * \author Borislav Pavlov - University of Sofia | ||
| */ | ||
|
|
||
| #include <cstdint> | ||
| #include <iosfwd> | ||
|
|
||
| class RPCDigiPhase2 { | ||
| public: | ||
| explicit RPCDigiPhase2(int strip, int bx, int sbx); | ||
| RPCDigiPhase2(); | ||
|
|
||
| bool operator==(const RPCDigiPhase2& digi) const; | ||
| bool operator<(const RPCDigiPhase2& digi) const; | ||
| void print() const; | ||
| int strip() const { return strip_; } | ||
| int bx() const { return bx_; } | ||
| int sbx() const { return sbx_; } | ||
|
|
||
| private: | ||
| uint16_t strip_; | ||
| int32_t bx_; // for BX | ||
| int8_t sbx_; // for sub-BX | ||
| }; | ||
|
|
||
| std::ostream& operator<<(std::ostream& o, const RPCDigiPhase2& digi); | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #ifndef RPCDigi_RPCDigiPhase2Collection_h | ||
| #define RPCDigi_RPCDigiPhase2Collection_h | ||
| /** \class RPCDigiCollection | ||
| * | ||
| * \author Borislav Pavlov | ||
| * \date 14 June 2024 | ||
| */ | ||
|
|
||
| #include <DataFormats/MuonDetId/interface/RPCDetId.h> | ||
| #include <DataFormats/RPCDigi/interface/RPCDigiPhase2.h> | ||
| #include <DataFormats/MuonData/interface/MuonDigiCollection.h> | ||
|
|
||
| typedef MuonDigiCollection<RPCDetId, RPCDigiPhase2> RPCDigiPhase2Collection; | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #include "DataFormats/RPCDigi/interface/RPCDigiPhase2.h" | ||
|
|
||
| class RPCDigiPhase2Time { | ||
| public: | ||
| RPCDigiPhase2Time(const RPCDigiPhase2& adigi); | ||
| float time(); | ||
|
|
||
| private: | ||
| RPCDigiPhase2 theDigi; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| /** \file | ||
| * | ||
| * | ||
| * \author Borislav Pavlov - University of Sofia | ||
| * | ||
| */ | ||
|
|
||
| #include "DataFormats/RPCDigi/interface/IRPCDigi.h" | ||
| #include <iostream> | ||
|
|
||
| IRPCDigi::IRPCDigi(int strip, int bxLR, int bxHR, int sbxLR, int sbxHR, int fineLR, int fineHR) | ||
| : strip_(strip), bxLR_(bxLR), bxHR_(bxHR), sbxLR_(sbxLR), sbxHR_(sbxHR), fineLR_(fineLR), fineHR_(fineHR) {} | ||
|
|
||
| IRPCDigi::IRPCDigi() : strip_(0), bxLR_(0), sbxLR_(0) {} | ||
|
|
||
| // Comparison | ||
| bool IRPCDigi::operator==(const IRPCDigi& digi) const { | ||
| if (strip_ != digi.strip() || bxLR_ != digi.bx()) | ||
| return false; | ||
| return true; | ||
|
Comment on lines
+18
to
+20
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. simplify: return strip_ == digi.strip() && bxLR_ = digi.bx(); |
||
| } | ||
|
|
||
| ///Precedence operator | ||
| bool IRPCDigi::operator<(const IRPCDigi& digi) const { | ||
| if (digi.bx() == this->bx()) | ||
| return digi.strip() < this->strip(); | ||
| else | ||
| return digi.bx() < this->bx(); | ||
| } | ||
|
|
||
| std::ostream& operator<<(std::ostream& o, const IRPCDigi& digi) { return o << " " << digi.strip() << " " << digi.bx(); } | ||
|
|
||
| void IRPCDigi::print() const { std::cout << "Strip " << strip() << " bx " << bx() << std::endl; } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #include "DataFormats/RPCDigi/interface/IRPCDigiTime.h" | ||
|
|
||
| IRPCDigiTime::IRPCDigiTime(const IRPCDigi& adigi) : theDigi(adigi) {} | ||
|
|
||
| float IRPCDigiTime::time() { return (timeLR() + timeHR()) / 2.; } | ||
|
|
||
| float IRPCDigiTime::coordinateY() { | ||
| const double signal_speed = 0.66 * 299792458e-7; //signal propagation speed [cm/ns] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in principle, physical constants like speed of light should be taken from a central source, but I'm not sure if e.g. CLHEP usage is recommended in DataFormats
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CLHEP dependence is allowed in DataFormats (we even have |
||
| return signal_speed * (timeLR() - timeHR()) / 2.; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
|
|
||
| float IRPCDigiTime::timeLR() { return TDC2Time(theDigi.bxLR(), theDigi.sbxLR(), theDigi.fineLR()); } | ||
|
|
||
| float IRPCDigiTime::timeHR() { return TDC2Time(theDigi.bxHR(), theDigi.sbxHR(), theDigi.fineHR()); } | ||
|
|
||
| float IRPCDigiTime::TDC2Time(int BX, int SBX, int FT) { return 25. * BX + 2.5 * SBX + 0.2 * FT; } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /** \file | ||
| * | ||
| * | ||
| * \author Borislav Pavlov - University of Sofia | ||
| * | ||
| */ | ||
|
|
||
| #include "DataFormats/RPCDigi/interface/RPCDigiPhase2.h" | ||
| #include <iostream> | ||
|
|
||
| RPCDigiPhase2::RPCDigiPhase2(int strip, int bx, int sbx) : strip_(strip), bx_(bx), sbx_(sbx) {} | ||
|
|
||
| RPCDigiPhase2::RPCDigiPhase2() : strip_(0), bx_(0), sbx_(0) {} | ||
|
|
||
| // Comparison | ||
| bool RPCDigiPhase2::operator==(const RPCDigiPhase2& digi) const { | ||
| if (strip_ != digi.strip() || bx_ != digi.bx()) | ||
| return false; | ||
| return true; | ||
|
Comment on lines
+17
to
+19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. simplify as above |
||
| } | ||
|
|
||
| ///Precedence operator | ||
| bool RPCDigiPhase2::operator<(const RPCDigiPhase2& digi) const { | ||
| if (digi.bx() == this->bx()) | ||
| return digi.strip() < this->strip(); | ||
| else | ||
| return digi.bx() < this->bx(); | ||
| } | ||
|
|
||
| std::ostream& operator<<(std::ostream& o, const RPCDigiPhase2& digi) { | ||
| return o << " " << digi.strip() << " " << digi.bx(); | ||
| } | ||
|
|
||
| void RPCDigiPhase2::print() const { std::cout << "Strip " << strip() << " bx " << bx() << std::endl; } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #include "DataFormats/RPCDigi/interface/RPCDigiPhase2Time.h" | ||
|
|
||
| RPCDigiPhase2Time::RPCDigiPhase2Time(const RPCDigiPhase2& adigi) : theDigi(adigi) {} | ||
|
|
||
| float RPCDigiPhase2Time::time() { | ||
| return 25. * theDigi.bx() + 1.5625 * theDigi.sbx(); // 25./16. = 1.5625 ns | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow code rule 4.1: this should be
#ifndef DataFormats_RPCDigi_IRPCDigi_h(& similar for all other header files in this PR)