Skip to content

Commit

Permalink
Clang-Format
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsbuild committed May 22, 2019
1 parent 9465086 commit 27137c3
Show file tree
Hide file tree
Showing 190 changed files with 10,668 additions and 11,152 deletions.
51 changes: 21 additions & 30 deletions EventFilter/LTCRawToDigi/src/LTCRawToDigi.cc
Expand Up @@ -2,7 +2,7 @@
//
// Package: LTCRawToDigi
// Class: LTCRawToDigi
//
//
/**\class LTCRawToDigi LTCRawToDigi.cc EventFilter/LTCRawToDigi/src/LTCRawToDigi.cc
Description: Unpack FED data to LTC bank. LTCs are FED id 816-823.
Expand All @@ -16,7 +16,6 @@
//
//


// system include files
#include <memory>

Expand All @@ -29,7 +28,7 @@

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

//FEDRawData
//FEDRawData
#include "DataFormats/FEDRawData/interface/FEDRawData.h"
#include "DataFormats/FEDRawData/interface/FEDNumbering.h"
#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
Expand All @@ -40,14 +39,14 @@
//

class LTCRawToDigi : public edm::EDProducer {
public:
explicit LTCRawToDigi(const edm::ParameterSet&);
~LTCRawToDigi() override;
public:
explicit LTCRawToDigi(const edm::ParameterSet&);
~LTCRawToDigi() override;

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

void produce(edm::Event&, const edm::EventSetup&) override;
private:
// ----------member data ---------------------------
private:
// ----------member data ---------------------------
};

//
Expand All @@ -61,48 +60,40 @@ class LTCRawToDigi : public edm::EDProducer {
//
// constructors and destructor
//
LTCRawToDigi::LTCRawToDigi(const edm::ParameterSet& iConfig)
{
//register your products
produces<LTCDigiCollection>();
LTCRawToDigi::LTCRawToDigi(const edm::ParameterSet& iConfig) {
//register your products
produces<LTCDigiCollection>();
}


LTCRawToDigi::~LTCRawToDigi()
{

// do anything here that needs to be done at desctruction time
// (e.g. close files, deallocate resources etc.)

LTCRawToDigi::~LTCRawToDigi() {
// do anything here that needs to be done at desctruction time
// (e.g. close files, deallocate resources etc.)
}


//
// member functions
//

// ------------ method called to produce the data ------------
void
LTCRawToDigi::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
{
void LTCRawToDigi::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
using namespace edm;
const int LTCFedIDLo = 815;
const int LTCFedIDHi = 823;

// Get a handle to the FED data collection
edm::Handle<FEDRawDataCollection> rawdata;
iEvent.getByLabel("source" , rawdata);
iEvent.getByLabel("source", rawdata);

// create collection we'll save in the event record
auto pOut = std::make_unique<LTCDigiCollection>();

// Loop over all possible FED's with the appropriate FED ID
for ( int id = LTCFedIDLo; id <= LTCFedIDHi; ++id ) {
for (int id = LTCFedIDLo; id <= LTCFedIDHi; ++id) {
/// Take a reference to this FED's data
const FEDRawData & fedData = rawdata->FEDData(id);
unsigned short int length = fedData.size();
if ( ! length )
continue; // bank does not exist
const FEDRawData& fedData = rawdata->FEDData(id);
unsigned short int length = fedData.size();
if (!length)
continue; // bank does not exist
LTCDigi ltcDigi(fedData.data());
pOut->push_back(ltcDigi);
}
Expand Down
92 changes: 36 additions & 56 deletions EventFilter/ScalersRawToDigi/src/ScalersRawToDigi.cc
Expand Up @@ -2,7 +2,7 @@
//
// Package: EventFilter/ScalersRawToDigi
// Class: ScalersRawToDigi
//
//
/**\class ScalersRawToDigi ScalersRawToDigi.cc EventFilter/ScalersRawToDigi/src/ScalersRawToDigi.cc
Description: Unpack FED data to Trigger and Lumi Scalers "bank"
Expand All @@ -23,7 +23,7 @@
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

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

Expand All @@ -37,52 +37,44 @@
#include "DataFormats/Scalers/interface/DcsStatus.h"
#include "DataFormats/Scalers/interface/ScalersRaw.h"

class ScalersRawToDigi : public edm::stream::EDProducer<>
{
public:
explicit ScalersRawToDigi(const edm::ParameterSet&);
~ScalersRawToDigi() override;
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

void produce(edm::Event&, const edm::EventSetup&) override;
class ScalersRawToDigi : public edm::stream::EDProducer<> {
public:
explicit ScalersRawToDigi(const edm::ParameterSet&);
~ScalersRawToDigi() override;
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
edm::InputTag inputTag_;
edm::EDGetTokenT<FEDRawDataCollection> fedToken_;
void produce(edm::Event&, const edm::EventSetup&) override;

private:
edm::InputTag inputTag_;
edm::EDGetTokenT<FEDRawDataCollection> fedToken_;
};

// Constructor
ScalersRawToDigi::ScalersRawToDigi(const edm::ParameterSet& iConfig):
inputTag_((char const *)"rawDataCollector")
{
ScalersRawToDigi::ScalersRawToDigi(const edm::ParameterSet& iConfig) : inputTag_((char const*)"rawDataCollector") {
produces<L1AcceptBunchCrossingCollection>();
produces<L1TriggerScalersCollection>();
produces<Level1TriggerScalersCollection>();
produces<LumiScalersCollection>();
produces<BeamSpotOnlineCollection>();
produces<DcsStatusCollection>();
if ( iConfig.exists("scalersInputTag") )
{
if (iConfig.exists("scalersInputTag")) {
inputTag_ = iConfig.getParameter<edm::InputTag>("scalersInputTag");
}
fedToken_=consumes<FEDRawDataCollection>(inputTag_);

fedToken_ = consumes<FEDRawDataCollection>(inputTag_);
}

// Destructor
ScalersRawToDigi::~ScalersRawToDigi() {}

void ScalersRawToDigi::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<edm::InputTag>("scalersInputTag",edm::InputTag("rawDataCollector"));
descriptions.add("scalersRawToDigi",desc);
desc.add<edm::InputTag>("scalersInputTag", edm::InputTag("rawDataCollector"));
descriptions.add("scalersRawToDigi", desc);
}

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

// Get a handle to the FED data collection
Expand All @@ -101,54 +93,42 @@ void ScalersRawToDigi::produce(edm::Event& iEvent,
auto pDcsStatus = std::make_unique<DcsStatusCollection>();

/// Take a reference to this FED's data
const FEDRawData & fedData = rawdata->FEDData(ScalersRaw::SCALERS_FED_ID);
unsigned short int length = fedData.size();
if ( length > 0 )
{
const FEDRawData& fedData = rawdata->FEDData(ScalersRaw::SCALERS_FED_ID);
unsigned short int length = fedData.size();
if (length > 0) {
int nWords = length / 8;
int nBytesExtra = 0;

const ScalersEventRecordRaw_v6 * raw
= (struct ScalersEventRecordRaw_v6 *)fedData.data();
if ( ( raw->version == 1 ) || ( raw->version == 2 ) )
{
const ScalersEventRecordRaw_v6* raw = (struct ScalersEventRecordRaw_v6*)fedData.data();
if ((raw->version == 1) || (raw->version == 2)) {
L1TriggerScalers oldTriggerScalers(fedData.data());
pOldTrigger->push_back(oldTriggerScalers);
nBytesExtra = length - sizeof(struct ScalersEventRecordRaw_v1);
}
else if ( raw->version >= 3 )
{
} else if (raw->version >= 3) {
Level1TriggerScalers triggerScalers(fedData.data());
pTrigger->push_back(triggerScalers);
if ( raw->version >= 6 )
{
nBytesExtra = ScalersRaw::N_BX_v6 * sizeof(unsigned long long);
}
else
{
nBytesExtra = ScalersRaw::N_BX_v2 * sizeof(unsigned long long);
if (raw->version >= 6) {
nBytesExtra = ScalersRaw::N_BX_v6 * sizeof(unsigned long long);
} else {
nBytesExtra = ScalersRaw::N_BX_v2 * sizeof(unsigned long long);
}
}

LumiScalers lumiScalers(fedData.data());
LumiScalers lumiScalers(fedData.data());
pLumi->push_back(lumiScalers);

if (( nBytesExtra >= 8 ) && (( nBytesExtra % 8 ) == 0 ))
{
unsigned long long * data =
(unsigned long long *)fedData.data();
if ((nBytesExtra >= 8) && ((nBytesExtra % 8) == 0)) {
unsigned long long* data = (unsigned long long*)fedData.data();

int nWordsExtra = nBytesExtra / 8;
for ( int i=0; i<nWordsExtra; i++)
{
int index = nWords - (nWordsExtra + 1) + i;
L1AcceptBunchCrossing bc(i,data[index]);
pBunch->push_back(bc);
for (int i = 0; i < nWordsExtra; i++) {
int index = nWords - (nWordsExtra + 1) + i;
L1AcceptBunchCrossing bc(i, data[index]);
pBunch->push_back(bc);
}
}

if ( raw->version >= 4 )
{
if (raw->version >= 4) {
BeamSpotOnline beamSpotOnline(fedData.data());
pBeamSpotOnline->push_back(beamSpotOnline);

Expand Down
15 changes: 7 additions & 8 deletions MagneticField/Layers/interface/MagBLayer.h
Expand Up @@ -18,7 +18,8 @@

class MagBSector;
class MagVolume;
template <class T> class PeriodicBinFinderInPhi;
template <class T>
class PeriodicBinFinderInPhi;

class MagBLayer {
public:
Expand All @@ -32,21 +33,19 @@ class MagBLayer {
virtual ~MagBLayer();

/// Find the volume containing a point, with a given tolerance
const MagVolume * findVolume(const GlobalPoint & gp, double tolerance) const;
const MagVolume* findVolume(const GlobalPoint& gp, double tolerance) const;

/// Lowest radius of the layer
double minR() const {return theRMin;}
double minR() const { return theRMin; }

private:
// To support either the case of a simple one-volume layer or a
// composite structure we have both theSectors or theSingleVolume.
// Only one can be active at a time; not very elegant, but acceptable.
std::vector<MagBSector*> theSectors;
MagVolume* theSingleVolume;
MagVolume* theSingleVolume;
double theRMin;

PeriodicBinFinderInPhi<float> * theBinFinder;

PeriodicBinFinderInPhi<float>* theBinFinder;
};
#endif

7 changes: 2 additions & 5 deletions MagneticField/Layers/interface/MagBRod.h
Expand Up @@ -31,17 +31,14 @@ class MagBRod {
virtual ~MagBRod();

/// Find the volume containing a point, with a given tolerance
const MagVolume * findVolume(const GlobalPoint & gp, double tolerance) const;
const MagVolume* findVolume(const GlobalPoint& gp, double tolerance) const;

/// Phi of rod start
Geom::Phi<float> minPhi() const {return thePhiMin;}
Geom::Phi<float> minPhi() const { return thePhiMin; }

private:
std::vector<MagBSlab*> theSlabs;
Geom::Phi<float> thePhiMin;
MagBinFinders::GeneralBinFinderInZ<double>* theBinFinder;

};
#endif


7 changes: 3 additions & 4 deletions MagneticField/Layers/interface/MagBSector.h
Expand Up @@ -27,17 +27,16 @@ class MagBSector {
MagBSector(std::vector<MagBRod*>& rods, Geom::Phi<float> phiMin);

/// Destructor
virtual ~MagBSector();
virtual ~MagBSector();

/// Find the volume containing a point, with a given tolerance
const MagVolume * findVolume(const GlobalPoint & gp, double tolerance) const;
const MagVolume* findVolume(const GlobalPoint& gp, double tolerance) const;

/// Phi of sector start
Geom::Phi<float> minPhi() const {return thePhiMin;}
Geom::Phi<float> minPhi() const { return thePhiMin; }

private:
std::vector<MagBRod*> theRods;
Geom::Phi<float> thePhiMin;
};
#endif

8 changes: 3 additions & 5 deletions MagneticField/Layers/interface/MagBSlab.h
Expand Up @@ -29,15 +29,13 @@ class MagBSlab {
virtual ~MagBSlab();

/// Find the volume containing a point, with a given tolerance
const MagVolume * findVolume(const GlobalPoint & gp, double tolerance) const;
const MagVolume* findVolume(const GlobalPoint& gp, double tolerance) const;

/// Lower Z bound
double minZ() const { return theZMin;}
double minZ() const { return theZMin; }

private:
std::vector<MagVolume*> theVolumes;
double theZMin;

};
#endif

7 changes: 3 additions & 4 deletions MagneticField/Layers/interface/MagELayer.h
Expand Up @@ -22,18 +22,17 @@ class MagELayer {
virtual ~MagELayer();

/// Find the volume containing a point, with a given tolerance
const MagVolume * findVolume(const GlobalPoint & gp, double tolerance) const;
const MagVolume* findVolume(const GlobalPoint& gp, double tolerance) const;

/// Lower Z bound
double minZ() const {return theZMin;}
double minZ() const { return theZMin; }

/// Upper Z bound
double maxZ() const {return theZMax;}
double maxZ() const { return theZMax; }

private:
std::vector<MagVolume*> theVolumes;
double theZMin;
double theZMax;
};
#endif

0 comments on commit 27137c3

Please sign in to comment.