-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Simulation of the pixel bad components on the FED channel basis #25466
Merged
cmsbuild
merged 30 commits into
cms-sw:master
from
CMSTrackerDPG:StuckTBM_from-CMSSW_10_4_X_2018-12-07-2300
Dec 18, 2018
Merged
Changes from 19 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
d489fa6
Introduce SiPixelFEDChannelContainer and SiPixelQualityProbabilitie…
mmusich ea97bf3
Simulatoin of the pixel bad FED channels
tsusa 367c7fd
add print methods and overloads for << operators, add protection agai…
mmusich 9bf8ff1
few fixes
tsusa 6d764b8
remove few comment
tsusa 1508af4
fix payload producer (SiPixelQuality->PixelFEDChannel conversion)
mmusich 7dc0126
fix compilation warning in SiPixelDigitizerAlgorithm
mmusich ca42547
Addressed comments on Condition Formats: avoided useless binary searc…
mmusich 8158047
Update SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc
makortel b200dd2
Update SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc
makortel a617764
Update SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc
makortel 38f7abe
Update SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc
makortel 9edf5e3
Update SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc
makortel 4f02e38
Update SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc
makortel c931969
Update SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc
makortel 70903fe
Update SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc
makortel 4e7d064
Update SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h
makortel e952c4d
Code improvements following Matti's comments
tsusa 459ff15
made InputTag configurable, set KillBadFEDChannels for premix_stage1
tsusa b791d99
Access CablingPathToDetUnit outside the loops
tsusa d14a25d
Change default for BadPixelFEDChannelsInputLabel, add modifier for pr…
tsusa 45b3870
adding PixelFEDChannelCollectionProducer and SiPixelFEDChannelContain…
mmusich 53f5d50
fix to register the C++ type in the ES
mmusich 07bba08
fix cfi for PixelFEDChannelCollectionProducer and add reader test
mmusich cd3bbcb
correct reading tests for SiPixelFEDChannelContainer and SiPixelQuali…
mmusich b00d60b
implement code-checks suggestion
mmusich 4c3cca1
move the PixelFEDChannelCollectionMap ES declaration to DataFormats/S…
mmusich f846731
Use new ESProducer
tsusa 5ea7ba4
Remove test and commented lines
tsusa 9873103
Remove commented line
tsusa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
19 changes: 19 additions & 0 deletions
19
CondFormats/DataRecord/interface/SiPixelStatusScenarioProbabilityRcd.h
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,19 @@ | ||
#ifndef SiPixelStatusScenarioProbabilityRcd_SiPixelStatusScenarioProbabilityRcd_h | ||
#define SiPixelStatusScenarioProbabilityRcd_SiPixelStatusScenarioProbabilityRcd_h | ||
// -*- C++ -*- | ||
// | ||
// Package: CondFormats/DataRecord | ||
// Class : SiPixelStatusScenarioProbabilityRcd | ||
// | ||
/**\class SiPixelStatusScenarioProbabilityRcd SiPixelStatusScenarioProbabilityRcd.h CondFormats/DataRecord/interface/SiPixelStatusScenarioProbabilityRcd.h | ||
Description: [one line class summary] | ||
Usage: | ||
<usage> | ||
*/ | ||
// | ||
// Author: Marco Musich | ||
// Created: Wed, 30 Nov 2018 11:44:30 GMT | ||
// | ||
#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" | ||
class SiPixelStatusScenarioProbabilityRcd : public edm::eventsetup::EventSetupRecordImplementation<SiPixelStatusScenarioProbabilityRcd> {}; | ||
#endif |
19 changes: 19 additions & 0 deletions
19
CondFormats/DataRecord/interface/SiPixelStatusScenariosRcd.h
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,19 @@ | ||
#ifndef SiPixelStatusScenariosRcd_SiPixelStatusScenariosRcd_h | ||
#define SiPixelStatusScenariosRcd_SiPixelStatusScenariosRcd_h | ||
// -*- C++ -*- | ||
// | ||
// Package: CondFormats/DataRecord | ||
// Class : SiPixelStatusScenariosRcd | ||
// | ||
/**\class SiPixelStatusScenariosRcd SiPixelStatusScenariosRcd.h CondFormats/DataRecord/interface/SiPixelStatusScenariosRcd.h | ||
Description: [one line class summary] | ||
Usage: | ||
<usage> | ||
*/ | ||
// | ||
// Author: Marco Musich | ||
// Created: Wed, 28 Nov 2018 10:31:30 GMT | ||
// | ||
#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" | ||
class SiPixelStatusScenariosRcd : public edm::eventsetup::EventSetupRecordImplementation<SiPixelStatusScenariosRcd> {}; | ||
#endif |
13 changes: 13 additions & 0 deletions
13
CondFormats/DataRecord/src/SiPixelStatusScenarioProbabilityRcd.cc
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,13 @@ | ||
// -*- C++ -*- | ||
// | ||
// Package: CondFormats/DataRecord | ||
// Class : SiPixelStatusScenarioProbabilityRcd | ||
// | ||
// Implementation: | ||
// [Notes on implementation] | ||
// | ||
// Author: Marco Musich | ||
// Created: Wed, 22 Feb 2017 10:31:30 GMT | ||
#include "CondFormats/DataRecord/interface/SiPixelStatusScenarioProbabilityRcd.h" | ||
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" | ||
EVENTSETUP_RECORD_REG(SiPixelStatusScenarioProbabilityRcd); |
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,13 @@ | ||
// -*- C++ -*- | ||
// | ||
// Package: CondFormats/DataRecord | ||
// Class : SiPixelStatusScenariosRcd | ||
// | ||
// Implementation: | ||
// [Notes on implementation] | ||
// | ||
// Author: Marco Musich | ||
// Created: Wed, 22 Feb 2017 10:31:30 GMT | ||
#include "CondFormats/DataRecord/interface/SiPixelStatusScenariosRcd.h" | ||
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" | ||
EVENTSETUP_RECORD_REG(SiPixelStatusScenariosRcd); |
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,69 @@ | ||
#ifndef CondFormats_External_PIXELFEDCHANNEL_H | ||
#define CondFormats_External_PIXELFEDCHANNEL_H | ||
|
||
#include <boost/serialization/base_object.hpp> | ||
#include <boost/serialization/nvp.hpp> | ||
#include <boost/serialization/split_free.hpp> | ||
|
||
#include <boost/serialization/vector.hpp> | ||
#include <boost/serialization/string.hpp> | ||
#include <boost/serialization/map.hpp> | ||
|
||
#include "DataFormats/SiPixelDetId/interface/PixelFEDChannel.h" | ||
|
||
// struct PixelFEDChannel { | ||
// unsigned int fed, link, roc_first, roc_last; | ||
// }; | ||
|
||
namespace boost { | ||
namespace serialization { | ||
|
||
/* | ||
* Note regarding object tracking: all autos used here | ||
* must resolve to untracked types, since we use local | ||
* variables in the stack which could end up with the same | ||
* address. For the moment, all types resolved by auto here | ||
* are primitive types, which are untracked by default | ||
* by Boost Serialization. | ||
*/ | ||
|
||
template<class Archive> | ||
void save(Archive & ar, const PixelFEDChannel & obj, const unsigned int) | ||
{ | ||
auto fed = obj.fed; | ||
auto link = obj.link; | ||
auto roc_first = obj.roc_first; | ||
auto roc_last = obj.roc_last; | ||
ar & boost::serialization::make_nvp("fed_" , fed ); | ||
ar & boost::serialization::make_nvp("link_" , link ); | ||
ar & boost::serialization::make_nvp("roc_first_" , roc_first ); | ||
ar & boost::serialization::make_nvp("roc_last_" , roc_last ); | ||
} | ||
|
||
template<class Archive> | ||
void load(Archive & ar, PixelFEDChannel & obj, const unsigned int) | ||
{ | ||
unsigned int fed_; | ||
unsigned int link_; | ||
unsigned int roc_first_; | ||
unsigned int roc_last_; | ||
|
||
ar & boost::serialization::make_nvp("fed_" , fed_ ); | ||
ar & boost::serialization::make_nvp("link_" , link_ ); | ||
ar & boost::serialization::make_nvp("roc_first_" , roc_first_ ); | ||
ar & boost::serialization::make_nvp("roc_last_" , roc_last_ ); | ||
PixelFEDChannel tmp{fed_, link_, roc_first_, roc_last_}; | ||
obj = tmp; | ||
|
||
} | ||
|
||
template<class Archive> | ||
void serialize(Archive & ar, PixelFEDChannel & obj, const unsigned int v) | ||
{ | ||
split_free(ar, obj, v); | ||
} | ||
|
||
} // namespace serialization | ||
} // namespace boost | ||
|
||
#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
50 changes: 50 additions & 0 deletions
50
CondFormats/SiPixelObjects/interface/SiPixelFEDChannelContainer.h
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,50 @@ | ||
#ifndef CondFormats_SiPixelObjects_SiPixelFEDChannelContainer_h | ||
#define CondFormats_SiPixelObjects_SiPixelFEDChannelContainer_h | ||
|
||
#include "CondFormats/Serialization/interface/Serializable.h" | ||
#include "DataFormats/DetId/interface/DetId.h" | ||
#include "DataFormats/SiPixelDetId/interface/PixelFEDChannel.h" // N.B. a DataFormat is serialized here (need for dedicated serialization rules, see CondFormats/External/interface/PixelFEDChannel.h) | ||
|
||
#include <map> | ||
#include <string> | ||
#include <vector> | ||
|
||
class SiPixelFEDChannelContainer{ | ||
public: | ||
typedef std::map<DetId,std::vector<PixelFEDChannel> > SiPixelFEDChannelCollection; | ||
typedef std::unordered_map<std::string, SiPixelFEDChannelCollection> SiPixelBadFEDChannelsScenarioMap; | ||
|
||
SiPixelFEDChannelContainer(){} | ||
SiPixelFEDChannelContainer( const SiPixelFEDChannelContainer& rhs ){ m_scenarioMap = rhs.getScenarioMap(); }; | ||
virtual ~SiPixelFEDChannelContainer(){} | ||
|
||
void setScenario(const std::string &theScenarioId, const SiPixelFEDChannelCollection &theBadFEDChannels); | ||
|
||
const SiPixelBadFEDChannelsScenarioMap& getScenarioMap () const {return m_scenarioMap;} | ||
|
||
SiPixelFEDChannelCollection getSiPixelBadFedChannels(const std::string &ScenarioId) const; | ||
const SiPixelFEDChannelCollection & getSiPixelBadFedChannels(const std::string &ScenarioId); | ||
|
||
const std::vector<PixelFEDChannel>& getSiPixelBadFedChannelsInDetId(const std::string &theScenarioId,DetId theDetId); | ||
|
||
std::unique_ptr<PixelFEDChannelCollection> getDetSetBadPixelFedChannels(const std::string &ScenarioId) const; | ||
|
||
double size()const {return m_scenarioMap.size();} | ||
std::vector<std::string> getScenarioList() const; | ||
|
||
void printAll() const; | ||
|
||
//dumping values on output stream | ||
void print(std::ostream & os) const; | ||
|
||
private: | ||
|
||
SiPixelBadFEDChannelsScenarioMap m_scenarioMap; | ||
|
||
COND_SERIALIZABLE; | ||
|
||
}; | ||
|
||
std::ostream & operator<<( std::ostream &, SiPixelFEDChannelContainer FEDChannels); | ||
|
||
#endif //CondFormats_SiPixelObjects_SiPixelFEDChannelContainer_h |
45 changes: 45 additions & 0 deletions
45
CondFormats/SiPixelObjects/interface/SiPixelQualityProbabilities.h
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,45 @@ | ||
#ifndef CondFormats_SiPixelObjects_SiPixelQualityProbabilities_h | ||
#define CondFormats_SiPixelObjects_SiPixelQualityProbabilities_h | ||
|
||
#include "CondFormats/Serialization/interface/Serializable.h" | ||
|
||
#include <map> | ||
#include <string> | ||
#include <vector> | ||
|
||
class SiPixelQualityProbabilities{ | ||
public: | ||
typedef std::vector<std::pair<std::string,float> > probabilityVec; | ||
typedef std::map<unsigned int,probabilityVec> probabilityMap; | ||
|
||
SiPixelQualityProbabilities(){} | ||
SiPixelQualityProbabilities( const SiPixelQualityProbabilities& rhs ){ m_probabilities = rhs.getProbability_Map(); }; | ||
virtual ~SiPixelQualityProbabilities(){} | ||
|
||
void setProbabilities(const unsigned int puBin, const probabilityVec &theProbabilities); | ||
|
||
const probabilityMap& getProbability_Map () const {return m_probabilities;} | ||
|
||
probabilityVec getProbabilities(const unsigned int puBin) const; | ||
const probabilityVec & getProbabilities(const unsigned int puBin); | ||
|
||
double size()const {return m_probabilities.size();} | ||
double nelements(const int puBin)const {return m_probabilities.at(puBin).size();} | ||
std::vector<unsigned int> getPileUpBins() const; | ||
|
||
void printAll() const; | ||
|
||
//dumping values on output stream | ||
void print(std::ostream & os) const; | ||
|
||
private: | ||
|
||
probabilityMap m_probabilities; | ||
|
||
COND_SERIALIZABLE; | ||
|
||
}; | ||
|
||
std::ostream & operator<<( std::ostream &, SiPixelQualityProbabilities theProbabilities); | ||
|
||
#endif //CondFormats_SiPixelObjects_SiPixelQualityProbabilities_h |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This choice requires the persistency of a non-CondFormats class ( correctly treated above in the CondFormats/External package ). Since the DataFormats class layouts are not guaranteed to be 'frozen', this brings potentially some non-zero ( although presumably very low ) risk of schema breaking in the future.
For this reason, the requirement of this dependency is expected to be well justified.
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.
Hi @ggovi,
thanks for your comment.
As I highlighted in the PR description: we don't foresee to ever have to change the content of the
DataFormat
, so schema evolution is implicitly avoided.The current format of the
edmnew::DetSetVector<PixelFEDChannel>
contains "redundant" information to find a FED channel (DetId
,FEDId
,LinkId
,first_roc
andlast_roc
). This is fine to describe any FED channel in phase-0 and phase-I detectors.The main con to code a dedicated container class within
CondFormat
(that has the advantage that is guaranteed not to break the schema), is that we'll need to code within each piece of client code (that understands thePixelFEDChannel
object) a conversion between theCondFormat
and theDataFormat
.