For version 029.
minimal changes for 53x
Backporting from 5x.
Version 027 - complete version for ICHEP 2012.
Add Particle Flow photons
Initial 5 version.
add crystal tilt axes to basic cluster
store ecal local coordinates
minimal compilation fixes for 42x
Fixed merging
Fix in SwissCross method for BasicClusters
// $Id: FillerBasicClusters.cc,v 1.11 2010/03/24 15:40:57 sixie Exp $ #include "MitProd/TreeFiller/interface/FillerBasicClusters.h" #include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h" #include "DataFormats/CaloRecHit/interface/CaloCluster.h" #include "MitAna/DataTree/interface/BasicClusterCol.h" #include "MitAna/DataTree/interface/Names.h" #include "MitProd/ObjectService/interface/ObjectService.h" #include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h" #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h" #include "DataFormats/EcalDetId/interface/EcalSubdetector.h" using namespace std; using namespace edm; using namespace mithep; //-------------------------------------------------------------------------------------------------- FillerBasicClusters::FillerBasicClusters(const ParameterSet &cfg, const char *name, bool active) : BaseFiller(cfg,name,active), edmName_(Conf().getUntrackedParameter<string>("edmName","hybridSuperClusters")), mitName_(Conf().getUntrackedParameter<string>("mitName","BasicClusters")), barrelEcalRecHitName_(Conf().getUntrackedParameter<string>("barrelEcalRecHitName","")), endcapEcalRecHitName_(Conf().getUntrackedParameter<string>("endcapEcalRecHitName","")), basicClusterMapName_(Conf().getUntrackedParameter<string>("basicClusterMapName", "BasicClusterMap")), basicClusters_(new mithep::BasicClusterArr(100)), basicClusterMap_(new mithep::BasicClusterMap) { // Constructor. } //-------------------------------------------------------------------------------------------------- FillerBasicClusters::~FillerBasicClusters() { // Destructor. delete basicClusters_; delete basicClusterMap_; } //-------------------------------------------------------------------------------------------------- void FillerBasicClusters::BookDataBlock(TreeWriter &tws) { // Add BasicCluster branch and the BasicClusterMap to tree. tws.AddBranch(mitName_,&basicClusters_); OS()->add<BasicClusterArr>(basicClusters_,mitName_); if (!basicClusterMapName_.empty()) { basicClusterMap_->SetBrName(mitName_); OS()->add<BasicClusterMap>(basicClusterMap_,basicClusterMapName_); } } //-------------------------------------------------------------------------------------------------- void FillerBasicClusters::FillDataBlock(const edm::Event &event, const edm::EventSetup &setup) { // Fill the BasicCluster information into our structures. basicClusters_->Delete(); basicClusterMap_->Reset(); Handle<reco::CaloClusterCollection> hBasicClusterProduct; GetProduct(edmName_, hBasicClusterProduct, event); basicClusterMap_->SetEdmProductId(hBasicClusterProduct.id().id()); const reco::CaloClusterCollection inBasicClusters = *(hBasicClusterProduct.product()); EcalClusterLazyTools lazyTools(event, setup, edm::InputTag(barrelEcalRecHitName_), edm::InputTag(endcapEcalRecHitName_)); // loop through all basic clusters for (reco::CaloClusterCollection::const_iterator inBC = inBasicClusters.begin(); inBC != inBasicClusters.end(); ++inBC) { mithep::BasicCluster *outBasicCluster = basicClusters_->Allocate(); new (outBasicCluster) mithep::BasicCluster(); outBasicCluster->SetXYZ(inBC->x(),inBC->y(),inBC->z()); outBasicCluster->SetEnergy(inBC->energy()); outBasicCluster->SetNHits(inBC->size()); outBasicCluster->SetE1x3(lazyTools.e1x3(*inBC)); outBasicCluster->SetE3x1(lazyTools.e3x1(*inBC)); outBasicCluster->SetE1x5(lazyTools.e1x5(*inBC)); outBasicCluster->SetE2x2(lazyTools.e2x2(*inBC)); outBasicCluster->SetE3x2(lazyTools.e3x2(*inBC)); outBasicCluster->SetE3x3(lazyTools.e3x3(*inBC)); outBasicCluster->SetE4x4(lazyTools.e4x4(*inBC)); outBasicCluster->SetE5x5(lazyTools.e5x5(*inBC)); outBasicCluster->SetE2x5Right(lazyTools.e2x5Right(*inBC)); outBasicCluster->SetE2x5Left(lazyTools.e2x5Left(*inBC)); outBasicCluster->SetE2x5Top(lazyTools.e2x5Top(*inBC)); outBasicCluster->SetE2x5Bottom(lazyTools.e2x5Bottom(*inBC)); outBasicCluster->SetE2x5Max(lazyTools.e2x5Max(*inBC)); outBasicCluster->SetELeft(lazyTools.eLeft(*inBC)); outBasicCluster->SetERight(lazyTools.eRight(*inBC)); outBasicCluster->SetETop(lazyTools.eTop(*inBC)); outBasicCluster->SetEBottom(lazyTools.eBottom(*inBC)); outBasicCluster->SetEMax(lazyTools.eMax(*inBC)); outBasicCluster->SetE2nd(lazyTools.e2nd(*inBC)); outBasicCluster->SetEtaLat(lazyTools.lat(*inBC)[0]); outBasicCluster->SetPhiLat(lazyTools.lat(*inBC)[1]); outBasicCluster->SetLat(lazyTools.lat(*inBC)[2]); outBasicCluster->SetCovEtaEta(lazyTools.covariances(*inBC)[0]); outBasicCluster->SetCovEtaPhi(lazyTools.covariances(*inBC)[1]); outBasicCluster->SetCovPhiPhi(lazyTools.covariances(*inBC)[2]); outBasicCluster->SetCoviEtaiEta(lazyTools.localCovariances(*inBC)[0]); outBasicCluster->SetCoviEtaiPhi(lazyTools.localCovariances(*inBC)[1]); outBasicCluster->SetCoviPhiiPhi(lazyTools.localCovariances(*inBC)[2]); outBasicCluster->SetZernike20(lazyTools.zernike20(*inBC)); outBasicCluster->SetZernike42(lazyTools.zernike42(*inBC)); edm::Handle< EcalRecHitCollection > pEBRecHits; event.getByLabel(barrelEcalRecHitName_, pEBRecHits ); const EcalRecHitCollection * ebRecHits_ = pEBRecHits.product(); edm::Handle< EcalRecHitCollection > pEERecHits; event.getByLabel( endcapEcalRecHitName_, pEERecHits ); const EcalRecHitCollection * eeRecHits_ = pEERecHits.product(); DetId id = ((*inBC).hitsAndFractions()[0]).first; const EcalRecHitCollection *recHits = 0; if ( id.subdetId() == EcalBarrel ) { recHits = ebRecHits_; } else if ( id.subdetId() == EcalEndcap ) { recHits = eeRecHits_; } float max = 0; DetId idmax(0); for ( size_t i = 0; i < (*inBC).hitsAndFractions().size(); ++i ) { float energy=0; if ((*inBC).hitsAndFractions()[i].first!=DetId(0)) energy= (*(recHits->find( id ))).energy() * (((*inBC).hitsAndFractions())[i].second); if ( energy > max ) { max = energy; id = ((*inBC).hitsAndFractions())[i].first; } } outBasicCluster->SetSwissCross(EcalSeverityLevelAlgo::swissCross(idmax,*recHits,0.)); // add basic clusters to the map reco::CaloClusterPtr thePtr(hBasicClusterProduct, inBC-inBasicClusters.begin()); basicClusterMap_->Add(thePtr, outBasicCluster); } basicClusters_->Trim(); }
Add EM shower shape variables
Fix beginrun,beginjob mess
Extended interface of BookDataBlock to contain event setup.
Cleanup
Accounted for BasicCluster to CaloCluster name change
Added proper fwd defs plus split up complilation of MitAna/DataTree LinkDefs.
Introduced BranchTable plus general cleanup.
Remove unused variables
Switch from Reset to Delete calls on arrays, since we now use some heap
Cleanup
Add BasicCluster and SuperCluster objects into the Data Tree, and their Fillers.
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.