Skip to content

Commit

Permalink
Fixes according to Andrea Bocci and Chris Jones
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Grunewald committed Mar 13, 2015
1 parent c1dab7a commit ceeb312
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions HLTrigger/HLTcore/interface/TriggerSummaryProducerAOD.h
Expand Up @@ -68,29 +68,29 @@ namespace edm {
struct InputTagHash {
std::size_t operator()(const edm::InputTag& inputTag) const {
std::hash<std::string> Hash;
return Hash(inputTag.encode());
// bit-wise xor
return Hash(inputTag.label()) ^ Hash(inputTag.instance()) ^ Hash(inputTag.process());
}
};

struct GlobalTags {
GlobalTags(): filterTagsGlobal_(),collectionTagsGlobal_(){ }
struct GlobalInputTags {
GlobalInputTags(): filterTagsGlobal_(),collectionTagsGlobal_(){ }
mutable tbb::concurrent_unordered_set<edm::InputTag,InputTagHash> filterTagsGlobal_;
mutable tbb::concurrent_unordered_set<edm::InputTag,InputTagHash> collectionTagsGlobal_;
};

class TriggerSummaryProducerAOD : public edm::stream::EDProducer<edm::GlobalCache<GlobalTags>> {
class TriggerSummaryProducerAOD : public edm::stream::EDProducer<edm::GlobalCache<GlobalInputTags>> {

public:
explicit TriggerSummaryProducerAOD(const edm::ParameterSet&, const GlobalTags *);
explicit TriggerSummaryProducerAOD(const edm::ParameterSet&, const GlobalInputTags *);
~TriggerSummaryProducerAOD();
static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
virtual void produce(edm::Event&, const edm::EventSetup&) override;
virtual void endStream() override;
static void globalEndJob(const GlobalTags *);
static void globalEndJob(const GlobalInputTags *);

// additional
static std::unique_ptr<GlobalTags> initializeGlobalCache(edm::ParameterSet const&) {
return std::unique_ptr<GlobalTags> (new GlobalTags());
static std::unique_ptr<GlobalInputTags> initializeGlobalCache(edm::ParameterSet const&) {
return std::unique_ptr<GlobalInputTags> (new GlobalInputTags());
};

template <typename C>
Expand Down
10 changes: 5 additions & 5 deletions HLTrigger/HLTcore/plugins/TriggerSummaryProducerAOD.cc
Expand Up @@ -47,7 +47,7 @@
//
// constructors and destructor
//
TriggerSummaryProducerAOD::TriggerSummaryProducerAOD(const edm::ParameterSet& ps, const GlobalTags * gt) :
TriggerSummaryProducerAOD::TriggerSummaryProducerAOD(const edm::ParameterSet& ps, const GlobalInputTags * gt) :
pn_(ps.getParameter<std::string>("processName")),
filterTagsEvent_(pn_!="*"),
filterTagsStream_(pn_!="*"),
Expand Down Expand Up @@ -544,20 +544,20 @@ void TriggerSummaryProducerAOD::endStream() {
return;
}

void TriggerSummaryProducerAOD::globalEndJob(const GlobalTags * globalTags) {
void TriggerSummaryProducerAOD::globalEndJob(const GlobalInputTags * globalInputTags) {

using namespace std;
using namespace edm;
using namespace trigger;

LogVerbatim("TriggerSummaryProducerAOD") << endl;
LogVerbatim("TriggerSummaryProducerAOD") << "TriggerSummaryProducerAOD::endJob - accumulated tags:" << endl;
LogVerbatim("TriggerSummaryProducerAOD") << "TriggerSummaryProducerAOD::globalEndJob - accumulated tags:" << endl;

InputTagSet filterTags(false);
InputTagSet collectionTags(false);

filterTags.insert(globalTags->filterTagsGlobal_.begin(),globalTags->filterTagsGlobal_.end());
collectionTags.insert(globalTags->collectionTagsGlobal_.begin(),globalTags->collectionTagsGlobal_.end());
filterTags.insert(globalInputTags->filterTagsGlobal_.begin(),globalInputTags->filterTagsGlobal_.end());
collectionTags.insert(globalInputTags->collectionTagsGlobal_.begin(),globalInputTags->collectionTagsGlobal_.end());

const unsigned int nc(collectionTags.size());
const unsigned int nf(filterTags.size());
Expand Down

0 comments on commit ceeb312

Please sign in to comment.