Skip to content

Commit

Permalink
Merge pull request #10452 from cerminar/PCLSiPixelAli_harvesting_74X_…
Browse files Browse the repository at this point in the history
…target_maxv1

First integration of Pixel Alignment of large structures in PCL (74X)
  • Loading branch information
davidlange6 committed Sep 30, 2015
2 parents 5395ccb + 23f0057 commit fd75af5
Show file tree
Hide file tree
Showing 37 changed files with 3,056 additions and 2,293 deletions.
2 changes: 2 additions & 0 deletions Alignment/CommonAlignment/interface/Alignable.h
Expand Up @@ -243,4 +243,6 @@ class Alignable

};

typedef std::vector<Alignable*> Alignables;

#endif
Expand Up @@ -2,11 +2,21 @@
#ifndef Alignment_CommonAlignmentAlgorithm_AlignmentAlgorithmBase_h
#define Alignment_CommonAlignmentAlgorithm_AlignmentAlgorithmBase_h

///
/// Base class for the alignment algorithm
///
/// Any algorithm should derive from this class
///
/**
* @package Alignment/CommonAlignmentAlgorithm
* @file AlignmentAlgorithmBase.h
*
* @author ???
*
* Last update:
* @author Max Stark (max.stark@cern.ch)
* @date 2015/07/16
*
* @brief Interface/Base class for alignment algorithms, each alignment
* algorithm has to be derived from this class
*/



#include <vector>
#include <utility>
Expand All @@ -32,11 +42,27 @@ class Trajectory;
namespace edm { class EventSetup; class ParameterSet; }
namespace reco { class Track; class BeamSpot; }

/*** Global typedefs part I (see EOF for part II) ***/
typedef std::pair<const Trajectory*, const reco::Track*> ConstTrajTrackPair;
typedef std::vector< ConstTrajTrackPair > ConstTrajTrackPairs;

typedef std::vector<IntegratedCalibrationBase*> Calibrations;

typedef cond::RealTimeType<cond::runnumber>::type RunNumber;
typedef std::pair<RunNumber,RunNumber> RunRange;
typedef std::vector<RunRange> RunRanges;



class AlignmentAlgorithmBase
{

public:

// TODO: DEPRECATED: For not breaking the interface, used in serveral files.
// If possible use the global typedefs above.
// With global typedefs one does not have to typedef again like
// 'typedef AlignmentAlgorithmBase::ConstTrajTrackPair ConstTrajTrackPair;'
// in other files.
typedef std::pair<const Trajectory*, const reco::Track*> ConstTrajTrackPair;
typedef std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection;
typedef cond::RealTimeType<cond::runnumber>::type RunNumber;
Expand Down Expand Up @@ -83,7 +109,7 @@ class AlignmentAlgorithmBase
};

/// Constructor
AlignmentAlgorithmBase(const edm::ParameterSet& cfg);
AlignmentAlgorithmBase(const edm::ParameterSet&) {};

/// Destructor
virtual ~AlignmentAlgorithmBase() {};
Expand All @@ -94,18 +120,27 @@ class AlignmentAlgorithmBase
AlignableMuon* muon,
AlignableExtras* extras,
AlignmentParameterStore* store ) = 0;
/// Pass integrated calibrations to algorithm, to be called after initialize(..).
/// (Calibrations' ownership is NOT passed to algorithm.)
/// Return whether feature is supported by algorithm,
/// default implementation returns false.
virtual bool addCalibrations(const std::vector<IntegratedCalibrationBase*> &iCals){return false;}

/// Call at start of loop
/// Default implementation is dummy for non-iterative algorithms
/// Returns whether calibrations is supported by algorithm,
/// default implementation returns false.
virtual bool supportsCalibrations() { return false; }
/// Pass integrated calibrations to algorithm, to be called after initialize()
/// Calibrations' ownership is NOT passed to algorithm
virtual bool addCalibrations(const Calibrations&) { return false; }

/// Returns whether algorithm proccesses events in current configuration
virtual bool processesEvents() { return true; }

// TODO: DEPRECATED: Actually, there are no iterative algorithms, use
// initialze() and terminate()
/// Called at start of loop, default implementation is dummy for
/// non-iterative algorithms
virtual void startNewLoop() {}

/// Call at end of each loop (must be implemented in derived class)
virtual void terminate(const edm::EventSetup& iSetup) = 0;
/// Called at end of job (must be implemented in derived class)
virtual void terminate() {}

/// Run the algorithm (must be implemented in derived class)
virtual void run( const edm::EventSetup &setup, const EventInfo &eventInfo) = 0;
Expand All @@ -127,4 +162,8 @@ class AlignmentAlgorithmBase
virtual bool setParametersForRunRange(const RunRange& rr) { return false; };
};

/*** Global typedefs part II ***/
typedef AlignmentAlgorithmBase::EventInfo EventInfo;
typedef AlignmentAlgorithmBase::EndRunInfo EndRunInfo;

#endif

This file was deleted.

Expand Up @@ -110,5 +110,7 @@ class AlignmentMonitorBase
std::map<std::vector<std::string>, TFileDirectory*> m_baseDirMap, m_iterDirMap;
};

/*** Global typedefs ***/
typedef std::vector<AlignmentMonitorBase*> AlignmentMonitors;

#endif
17 changes: 17 additions & 0 deletions Alignment/CommonAlignmentProducer/plugins/BuildFile.xml
Expand Up @@ -6,6 +6,20 @@
<use name="CondFormats/AlignmentRecord"/>
</library>
<library name="AlignmentCommonAlignmentProducerPlugin" file="AlignmentProducer.cc">
<use name="Alignment/CommonAlignment"/>
<use name="Alignment/CommonAlignmentAlgorithm"/>
<use name="Alignment/CommonAlignmentMonitor"/>
<use name="Alignment/CommonAlignmentParametrization"/>
<use name="Alignment/MuonAlignment"/>
<use name="Alignment/TrackerAlignment"/>
<use name="CondCore/DBOutputService"/>
<use name="CondFormats/Alignment"/>
<use name="CondFormats/AlignmentRecord"/>
<use name="CondFormats/GeometryObjects"/>
<use name="FWCore/ServiceRegistry"/>
<use name="boost"/>
</library>
<library name="AlignmentPCLTrackerAlignmentProducerPlugin" file="PCLTrackerAlProducer.cc">
<use name="Alignment/CommonAlignment"/>
<use name="Alignment/CommonAlignmentAlgorithm"/>
<use name="Alignment/CommonAlignmentMonitor"/>
Expand Down Expand Up @@ -58,3 +72,6 @@
<use name="DataFormats/DTRecHit"/>
<use name="DataFormats/RPCRecHit"/>
</library>
<library file="LSNumberFilter.cc" name="AlignmentCommonAlignmentProducerFilter">
<flags EDM_PLUGIN="1"/>
</library>
76 changes: 76 additions & 0 deletions Alignment/CommonAlignmentProducer/plugins/LSNumberFilter.cc
@@ -0,0 +1,76 @@
//#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDFilter.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Run.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"

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



//
// class declaration
//



class LSNumberFilter : public edm::EDFilter {
public:
explicit LSNumberFilter(const edm::ParameterSet&);
~LSNumberFilter();

private:

virtual void beginJob() override ;
virtual bool filter(edm::Event&, const edm::EventSetup&) override;
virtual void endJob() override ;

unsigned int minLS;
};



LSNumberFilter::LSNumberFilter(const edm::ParameterSet& iConfig):
minLS(iConfig.getUntrackedParameter<unsigned>("minLS",21))
{}


LSNumberFilter::~LSNumberFilter()
{

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

}


//
// member functions
//

// ------------ method called on each new Event ------------
bool LSNumberFilter::filter(edm::Event& iEvent,
const edm::EventSetup& iSetup) {

if(iEvent.luminosityBlock() < minLS) return false;

return true;

}

// ------------ method called once each job just before starting event loop ------------
void
LSNumberFilter::beginJob()
{}

// ------------ method called once each job just after ending the event loop ------------
void
LSNumberFilter::endJob() {
}

//define this as a plug-in
DEFINE_FWK_MODULE(LSNumberFilter);

0 comments on commit fd75af5

Please sign in to comment.