Skip to content

Commit

Permalink
Merge pull request #9394 from capalmer85/add-luminibble-unpacker
Browse files Browse the repository at this point in the history
Add luminibble unpacker
  • Loading branch information
davidlange6 committed Jun 12, 2015
2 parents 18de897 + 0c0ebd0 commit eb6ebd4
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Configuration/EventContent/python/EventContent_cff.py
Expand Up @@ -62,6 +62,7 @@

# raw2digi that are already the final RECO/AOD products
from EventFilter.ScalersRawToDigi.Scalers_EventContent_cff import *
from EventFilter.Utilities.Tcds_EventContent_cff import *

#DigiToRaw content
from EventFilter.Configuration.DigiToRaw_EventContent_cff import *
Expand Down Expand Up @@ -446,6 +447,7 @@
RECOEventContent.outputCommands.extend(HLTriggerRECO.outputCommands)
RECOEventContent.outputCommands.extend(MEtoEDMConverterRECO.outputCommands)
RECOEventContent.outputCommands.extend(EvtScalersRECO.outputCommands)
RECOEventContent.outputCommands.extend(TcdsEventContent.outputCommands)
RECOEventContent.outputCommands.extend(CommonEventContent.outputCommands)
RECOEventContent.outputCommands.extend(EITopPAGEventContent.outputCommands)

Expand Down Expand Up @@ -475,6 +477,7 @@
AODEventContent.outputCommands.extend(HLTriggerAOD.outputCommands)
AODEventContent.outputCommands.extend(MEtoEDMConverterAOD.outputCommands)
AODEventContent.outputCommands.extend(EvtScalersAOD.outputCommands)
AODEventContent.outputCommands.extend(TcdsEventContent.outputCommands)
AODEventContent.outputCommands.extend(CommonEventContent.outputCommands)
AODEventContent.outputCommands.extend(SimGeneralAOD.outputCommands)
AODEventContent.outputCommands.extend(EITopPAGEventContent.outputCommands)
Expand Down Expand Up @@ -592,6 +595,7 @@
FEVTEventContent.outputCommands.extend(HLTriggerRECO.outputCommands)
FEVTEventContent.outputCommands.extend(MEtoEDMConverterRECO.outputCommands)
FEVTEventContent.outputCommands.extend(EvtScalersRECO.outputCommands)
FEVTEventContent.outputCommands.extend(TcdsEventContent.outputCommands)
FEVTEventContent.outputCommands.extend(CommonEventContent.outputCommands)
FEVTEventContent.outputCommands.extend(EITopPAGEventContent.outputCommands)

Expand Down Expand Up @@ -643,6 +647,7 @@
FEVTSIMEventContent.outputCommands.extend(EvtScalersRECO.outputCommands)
FEVTSIMEventContent.outputCommands.extend(CommonEventContent.outputCommands)
FEVTSIMEventContent.outputCommands.extend(EITopPAGEventContent.outputCommands)
FEVTSIMEventContent.outputCommands.extend(TcdsEventContent.outputCommands)
RAWDEBUGEventContent.outputCommands.extend(RAWSIMEventContent.outputCommands)
RAWDEBUGEventContent.outputCommands.extend(SimTrackerDEBUG.outputCommands)
RAWDEBUGEventContent.outputCommands.extend(SimGeneralFEVTDEBUG.outputCommands)
Expand Down
6 changes: 4 additions & 2 deletions Configuration/StandardSequences/python/RawToDigi_Data_cff.py
Expand Up @@ -16,7 +16,8 @@
+muonDTDigis
+muonRPCDigis
+castorDigis
+scalersRawToDigi)
+scalersRawToDigi
+tcdsDigis)

RawToDigi_woGCT = cms.Sequence(csctfDigis
+dttfDigis
Expand All @@ -31,7 +32,8 @@
+muonDTDigis
+muonRPCDigis
+castorDigis
+scalersRawToDigi)
+scalersRawToDigi
+tcdsDigis)

ecalDigis.DoRegional = False

Expand Down
9 changes: 7 additions & 2 deletions Configuration/StandardSequences/python/RawToDigi_cff.py
Expand Up @@ -50,6 +50,9 @@

from EventFilter.ScalersRawToDigi.ScalersRawToDigi_cfi import *

from EventFilter.Utilities.tcdsRawToDigi_cfi import *
tcdsDigis = EventFilter.Utilities.tcdsRawToDigi_cfi.tcdsRawToDigi.clone()

RawToDigi = cms.Sequence(csctfDigis
+dttfDigis
+gctDigis
Expand All @@ -64,7 +67,8 @@
+muonDTDigis
+muonRPCDigis
+castorDigis
+scalersRawToDigi)
+scalersRawToDigi
+tcdsDigis)

RawToDigi_noTk = cms.Sequence(csctfDigis
+dttfDigis
Expand All @@ -78,7 +82,8 @@
+muonDTDigis
+muonRPCDigis
+castorDigis
+scalersRawToDigi)
+scalersRawToDigi
+tcdsDigis)

scalersRawToDigi.scalersInputTag = 'rawDataCollector'
csctfDigis.producer = 'rawDataCollector'
Expand Down
119 changes: 119 additions & 0 deletions EventFilter/Utilities/plugins/TcdsRawToDigi.cc
@@ -0,0 +1,119 @@
// -*- C++ -*-
//
// Package: ProdTutorial/TcdsRawToDigi
// Class: TcdsRawToDigi
//
/**\class TcdsRawToDigi TcdsRawToDigi.cc ProdTutorial/TcdsRawToDigi/plugins/TcdsRawToDigi.cc
Description: Producer to unpack lumi nibble from TCDS
*/
//
// Original Author: Chris Palmer
// Created: Thu, 28 May 2015 19:54:56 GMT
//
//


// system include files
#include <memory>
#include <iostream>

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/stream/EDProducer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"


#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
#include "DataFormats/FEDRawData/interface/FEDHeader.h"
#include "DataFormats/FEDRawData/interface/FEDTrailer.h"
#include "DataFormats/FEDRawData/interface/FEDNumbering.h"

#include "EventFilter/FEDInterface/interface/GlobalEventNumber.h"
#include "EventFilter/FEDInterface/interface/FED1024.h"

#include "DataFormats/FEDRawData/interface/FEDRawData.h"


using namespace std;

//
// class declaration
//


class TcdsRawToDigi : public edm::stream::EDProducer<> {
public:
explicit TcdsRawToDigi(const edm::ParameterSet&);
~TcdsRawToDigi();

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
virtual void produce(edm::Event&, const edm::EventSetup&) override;

edm::EDGetTokenT<FEDRawDataCollection> dataToken_;

};

TcdsRawToDigi::TcdsRawToDigi(const edm::ParameterSet& iConfig)
{
edm::InputTag dataLabel = iConfig.getParameter<edm::InputTag>("InputLabel");
dataToken_=consumes<FEDRawDataCollection>(dataLabel);
produces<int>( "nibble" ).setBranchAlias( "nibble");
}


TcdsRawToDigi::~TcdsRawToDigi()
{
}


//
// member functions
//

// ------------ method called to produce the data ------------
void TcdsRawToDigi::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
{
using namespace edm;

edm::Handle<FEDRawDataCollection> rawdata;
iEvent.getByToken(dataToken_,rawdata);

int nibble=-99;
if( rawdata.isValid() ) {
const FEDRawData& tcdsData = rawdata->FEDData(FEDNumbering::MINTCDSuTCAFEDID);
if(tcdsData.size()>0){
evf::evtn::TCDSRecord tcdsRecord(tcdsData.data());
nibble = (int)tcdsRecord.getHeader().getData().header.nibble;
} else {
nibble=-2;
}
} else {
nibble=-1;
}
//std::cout<<"nibble is "<<nibble<<std::endl;

std::unique_ptr<int> pOut(new int(nibble));
iEvent.put( std::move(pOut), "nibble" );
}


// ------------ method fills 'descriptions' with the allowed parameters for the module ------------
void
TcdsRawToDigi::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
//The following says we do not know what parameters are allowed so do no validation
// Please change this to state exactly what you do use, even if it is no parameters
edm::ParameterSetDescription desc;
desc.add<edm::InputTag>("InputLabel",edm::InputTag("rawDataCollector"));
descriptions.add("tcdsRawToDigi", desc);
}

//define this as a plug-in
DEFINE_FWK_MODULE(TcdsRawToDigi);
11 changes: 11 additions & 0 deletions EventFilter/Utilities/python/Tcds_EventContent_cff.py
@@ -0,0 +1,11 @@
import FWCore.ParameterSet.Config as cms
#
# Author: Chris Palmer
# Date: 02.06.15
#

TcdsEventContent = cms.PSet(
outputCommands = cms.untracked.vstring(
'keep *_tcdsDigis_*_*'
)
)

0 comments on commit eb6ebd4

Please sign in to comment.