Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the possibility of a FrontEnd map for HCAL
- Loading branch information
Sunanda
committed
May 11, 2016
1 parent
40be73e
commit a62017b
Showing
24 changed files
with
444 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#ifndef HcalFrontEndMapRcd_H | ||
#define HcalFrontEndMapRcd_H | ||
#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" | ||
class HcalFrontEndMapRcd : public edm::eventsetup::EventSetupRecordImplementation<HcalFrontEndMapRcd> {}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "CondFormats/DataRecord/interface/HcalFrontEndMapRcd.h" | ||
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" | ||
EVENTSETUP_RECORD_REG(HcalFrontEndMapRcd); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#ifndef HcalFrontEndMap_h | ||
#define HcalFrontEndMap_h | ||
|
||
#include "CondFormats/Serialization/interface/Serializable.h" | ||
|
||
#include <vector> | ||
#include <algorithm> | ||
#include <boost/cstdint.hpp> | ||
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__) | ||
#include <atomic> | ||
#endif | ||
|
||
#include "DataFormats/DetId/interface/DetId.h" | ||
#include "DataFormats/HcalDetId/interface/HcalDetId.h" | ||
// | ||
class HcalFrontEndMap { | ||
public: | ||
HcalFrontEndMap(); | ||
~HcalFrontEndMap(); | ||
|
||
// swap function | ||
void swap(HcalFrontEndMap& other); | ||
// copy-ctor | ||
HcalFrontEndMap(const HcalFrontEndMap& src); | ||
// copy assignment operator | ||
HcalFrontEndMap& operator=(const HcalFrontEndMap& rhs); | ||
// move constructor | ||
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__) | ||
HcalFrontEndMap(HcalFrontEndMap&& other); | ||
#endif | ||
|
||
/// load a new entry | ||
bool loadObject(DetId fId, int rm, std::string rbx); | ||
|
||
/// brief lookup the RM associated with the given logical id | ||
//return Null item if no such mapping | ||
const int lookupRM(DetId fId) const; | ||
|
||
/// brief lookup the RBX associated with the given logical id | ||
//return Null item if no such mapping | ||
const std::string lookupRBX(DetId fId) const; | ||
const int lookupRBXIndex(DetId fId) const; | ||
|
||
std::vector <DetId> allDetIds() const; | ||
std::vector <int> allRMs() const; | ||
std::vector <std::string> allRBXs() const; | ||
|
||
// sorting | ||
void sortById () const; | ||
void sort() {} | ||
|
||
class PrecisionItem { | ||
public: | ||
PrecisionItem () {mId = mRM = 0; mRBX = "";} | ||
PrecisionItem (uint32_t fId, int fRM, std::string fRBX) | ||
: mId (fId), mRM (fRM), mRBX (fRBX) {} | ||
uint32_t mId; | ||
int mRM; | ||
std::string mRBX; | ||
|
||
COND_SERIALIZABLE; | ||
}; | ||
protected: | ||
const PrecisionItem* findById (uint32_t fId) const; | ||
|
||
std::vector<PrecisionItem> mPItems; | ||
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__) | ||
mutable std::atomic<std::vector<const PrecisionItem*>*> mPItemsById COND_TRANSIENT; | ||
#else | ||
mutable std::vector<const PrecisionItem*>* mPItemsById COND_TRANSIENT; | ||
#endif | ||
|
||
COND_SERIALIZABLE; | ||
}; | ||
|
||
#endif |
Oops, something went wrong.