Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/CMSSW_7_0_X' into CMSSW_7_0_X
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsbuild committed Nov 23, 2013
2 parents 5a1d567 + 9fbcae3 commit 974d97a
Show file tree
Hide file tree
Showing 18 changed files with 359 additions and 412 deletions.
14 changes: 13 additions & 1 deletion Geometry/CaloGeometry/interface/CaloCellGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ a default that the derived class author has to call deliberately if he wants it:
};
@endcode
$Revision: 1.21 $
\author J. Mans, P. Meridiani
*/

Expand Down Expand Up @@ -78,6 +77,8 @@ class CaloCellGeometry
float etaPos() const { return m_eta;}
float phiPos() const { return m_phi;}

float etaSpan() const { return m_dEta;}
float phiSpan() const { return m_dPhi;}


/// Returns true if the specified point is inside this cell
Expand Down Expand Up @@ -116,11 +117,22 @@ class CaloCellGeometry

CaloCellGeometry( void );

// MUST be called by children constructors
void initSpan() const {
m_dEta = std::abs(getCorners()[0].eta()-
getCorners()[2].eta());
m_dPhi = std::abs(getCorners()[0].phi() -
getCorners()[2].phi());
}

private:
GlobalPoint m_refPoint ;
mutable CornersVec m_corners ;
const CCGFloat* m_parms ;
float m_eta, m_phi;
mutable float m_dEta;
mutable float m_dPhi;

};

std::ostream& operator<<( std::ostream& s, const CaloCellGeometry& cell ) ;
Expand Down
2 changes: 1 addition & 1 deletion Geometry/CaloGeometry/interface/PreshowerStrip.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PreshowerStrip : public CaloCellGeometry
PreshowerStrip( const GlobalPoint& po ,
const CornersMgr* mgr ,
const CCGFloat* parm ) :
CaloCellGeometry ( po , mgr, parm ) {}
CaloCellGeometry ( po , mgr, parm ) {initSpan();}

virtual ~PreshowerStrip();

Expand Down
2 changes: 0 additions & 2 deletions Geometry/CaloGeometry/src/CaloCellGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ CaloCellGeometry::~CaloCellGeometry()





CaloCellGeometry::CaloCellGeometry( CornersVec::const_reference gp ,
const CornersMgr* mgr,
const CCGFloat* par ) :
Expand Down
2 changes: 1 addition & 1 deletion Geometry/CaloGeometry/src/IdealObliquePrism.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ IdealObliquePrism::IdealObliquePrism( const GlobalPoint& faceCenter,
const CornersMgr* mgr ,
const CCGFloat* parm )
: CaloCellGeometry ( faceCenter, mgr, parm )
{}
{initSpan();}

IdealObliquePrism::~IdealObliquePrism()
{}
Expand Down
2 changes: 1 addition & 1 deletion Geometry/CaloGeometry/src/IdealZPrism.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ IdealZPrism::IdealZPrism( const GlobalPoint& faceCenter ,
const CornersMgr* mgr ,
const CCGFloat* parm )
: CaloCellGeometry ( faceCenter, mgr, parm )
{}
{initSpan();}

IdealZPrism::~IdealZPrism()
{}
Expand Down
4 changes: 2 additions & 2 deletions Geometry/CaloGeometry/src/TruncatedPyramid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ TruncatedPyramid::TruncatedPyramid( const CornersMgr* cMgr ,
CaloCellGeometry ( fCtr, cMgr, parV ) ,
m_axis ( ( bCtr - fCtr ).unit() ) ,
m_corOne ( cor1.x(), cor1.y(), cor1.z() )
{}
{initSpan();}

TruncatedPyramid::TruncatedPyramid( const CornersVec& corn ,
const CCGFloat* par ) :
CaloCellGeometry ( corn, par ) ,
m_axis ( makeAxis() ) ,
m_corOne ( corn[0].x(), corn[0].y(), corn[0].z() )
{}
{initSpan();}

TruncatedPyramid::~TruncatedPyramid()
{}
Expand Down
3 changes: 1 addition & 2 deletions Geometry/ForwardGeometry/src/IdealCastorTrapezoid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ IdealCastorTrapezoid::IdealCastorTrapezoid( const GlobalPoint& faceCenter,
const CornersMgr* mgr ,
const CCGFloat* parm )
: CaloCellGeometry ( faceCenter, mgr, parm )
{
}
{initSpan();}

IdealCastorTrapezoid::~IdealCastorTrapezoid()
{
Expand Down
3 changes: 1 addition & 2 deletions Geometry/ForwardGeometry/src/IdealZDCTrapezoid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ IdealZDCTrapezoid::IdealZDCTrapezoid( const GlobalPoint& faceCenter,
const CornersMgr* mgr ,
const CCGFloat* parm ) :
CaloCellGeometry ( faceCenter, mgr, parm )
{
}
{initSpan();}

IdealZDCTrapezoid::~IdealZDCTrapezoid() {}

Expand Down
28 changes: 14 additions & 14 deletions MuonAnalysis/MomentumScaleCalibration/plugins/MuScleFitUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1989,13 +1989,13 @@ std::vector<TGraphErrors*> MuScleFitUtils::fitMass (TH2F* histo) {

// Cleanup
// -------
delete x;
delete ym;
delete eym;
delete yw;
delete eyw;
delete yc;
delete e;
delete[] x;
delete[] ym;
delete[] eym;
delete[] yw;
delete[] eyw;
delete[] yc;
delete[] e;
delete fitFcn;

results.push_back(grM);
Expand Down Expand Up @@ -2099,13 +2099,13 @@ std::vector<TGraphErrors*> MuScleFitUtils::fitReso (TH2F* histo) {

// Cleanup
// -------
delete x;
delete ym;
delete eym;
delete yw;
delete eyw;
delete yc;
delete e;
delete[] x;
delete[] ym;
delete[] eym;
delete[] yw;
delete[] eyw;
delete[] yc;
delete[] e;
delete fitFcn;

results.push_back (grM);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,7 @@ class Multi5x5BremRecoveryClusterAlgo
void makeIslandSuperClusters(reco::CaloClusterPtrVector &clusters_v,
double etaRoad, double phiRoad);

// return true if the cluster is within the search phi-eta window of the seed
bool match(reco::CaloClusterPtr seed_p,
reco::CaloClusterPtr cluster_p,
double etaRoad, double phiRoad);

//


double eb_rdeta_;
double eb_rdphi_;
double ec_rdeta_;
Expand Down
188 changes: 91 additions & 97 deletions RecoEcal/EgammaClusterAlgos/src/Multi5x5BremRecoveryClusterAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,102 +43,96 @@ void Multi5x5BremRecoveryClusterAlgo::makeIslandSuperClusters(reco::CaloClusterP
double etaRoad, double phiRoad)
{

std::vector<DetId> usedSeedDetIds;
usedSeedDetIds.clear();

for (reco::CaloCluster_iterator currentSeed = clusters_v.begin(); currentSeed != clusters_v.end(); ++currentSeed)
{

// check this seed was not already used
if (std::find(usedSeedDetIds.begin(), usedSeedDetIds.end(), (*currentSeed)->seed())
!= usedSeedDetIds.end()) continue;

// Does our highest energy cluster have high enough energy?
// changed this to continue from break (to be robust against the order of sorting of the seed clusters)
if ((*currentSeed)->energy() * sin((*currentSeed)->position().theta()) < seedTransverseEnergyThreshold) continue;

// if yes, make it a seed for a new SuperCluster:
double energy = (*currentSeed)->energy();
math::XYZVector position_((*currentSeed)->position().X(),
(*currentSeed)->position().Y(),
(*currentSeed)->position().Z());
position_ *= energy;
usedSeedDetIds.push_back((*currentSeed)->seed());

LogTrace("EcalClusters") << "*****************************";
LogTrace("EcalClusters") << "******NEW SUPERCLUSTER*******";
LogTrace("EcalClusters") << "Seed R = " << (*currentSeed)->position().Rho();

reco::CaloClusterPtrVector constituentClusters;
constituentClusters.push_back(*currentSeed);
reco::CaloCluster_iterator currentCluster = currentSeed + 1;

while (currentCluster != clusters_v.end())
{

// if dynamic phi road is enabled then compute the phi road for a cluster
// of energy of existing clusters + the candidate cluster.
if (dynamicPhiRoad_)
phiRoad = phiRoadAlgo_->endcapPhiRoad(energy + (*currentCluster)->energy());

// does the cluster match the phi road for this candidate supercluster
if (match(*currentSeed, *currentCluster, etaRoad, phiRoad) &&
std::find(usedSeedDetIds.begin(), usedSeedDetIds.end(), (*currentCluster)->seed()) == usedSeedDetIds.end())
{

// add basic cluster to supercluster constituents
constituentClusters.push_back(*currentCluster);
energy += (*currentCluster)->energy();
position_ += (*currentCluster)->energy() * math::XYZVector((*currentCluster)->position().X(),
(*currentCluster)->position().Y(),
(*currentCluster)->position().Z());

// remove cluster from vector of available clusters
usedSeedDetIds.push_back((*currentCluster)->seed());
LogTrace("EcalClusters") << "Cluster R = " << (*currentCluster)->position().Rho();
}
++currentCluster;

}

position_ /= energy;

LogTrace("EcalClusters") <<"Final SuperCluster R = " << position_.Rho();

reco::SuperCluster newSuperCluster(energy,
math::XYZPoint(position_.X(), position_.Y(), position_.Z()),
(*currentSeed),
constituentClusters);

superclusters_v.push_back(newSuperCluster);
LogTrace("EcalClusters") << "created a new supercluster of: ";
LogTrace("EcalClusters") << "Energy = " << newSuperCluster.energy();
LogTrace("EcalClusters") << "Position in (R, phi, theta) = ("
<< newSuperCluster.position().Rho() << ", "
<< newSuperCluster.position().phi() << ", "
<< newSuperCluster.position().theta() << ")" ;


}

clusters_v.clear();

}


bool Multi5x5BremRecoveryClusterAlgo::match(reco::CaloClusterPtr seed_p,
reco::CaloClusterPtr cluster_p,
double dEtaMax, double dPhiMax)
{
math::XYZPoint clusterPosition = cluster_p->position();
math::XYZPoint seedPosition = seed_p->position();

double dPhi = acos(cos(seedPosition.phi() - clusterPosition.phi()));

double dEta = fabs(seedPosition.eta() - clusterPosition.eta());

if (dEta > dEtaMax) return false;
if (dPhi > dPhiMax) return false;

return true;
bool usedSeed[clusters_v.size()];
for (auto ic=0U; ic<clusters_v.size(); ++ic) usedSeed[ic]=false;

float eta[clusters_v.size()], phi[clusters_v.size()], et[clusters_v.size()];
for (auto ic=0U; ic<clusters_v.size(); ++ic) {
eta[ic]=clusters_v[ic]->eta();
phi[ic]=clusters_v[ic]->phi();
et[ic]=clusters_v[ic]->energy() * sin(clusters_v[ic]->position().theta());
}

for (auto is=0U; is<clusters_v.size(); ++is) {
// check this seed was not already used
if (usedSeed[is]) continue;
auto const & currentSeed = clusters_v[is];

// Does our highest energy cluster have high enough energy?
// changed this to continue from break (to be robust against the order of sorting of the seed clusters)
if (et[is] < seedTransverseEnergyThreshold) continue;

// if yes, make it a seed for a new SuperCluster:
double energy = (currentSeed)->energy();
math::XYZVector position_((currentSeed)->position().X(),
(currentSeed)->position().Y(),
(currentSeed)->position().Z());
position_ *= energy;
usedSeed[is]=true;

LogTrace("EcalClusters") << "*****************************";
LogTrace("EcalClusters") << "******NEW SUPERCLUSTER*******";
LogTrace("EcalClusters") << "Seed R = " << (currentSeed)->position().Rho();

reco::CaloClusterPtrVector constituentClusters;
constituentClusters.push_back(currentSeed);
auto ic = is + 1;

while (ic < clusters_v.size()) {
auto const & currentCluster = clusters_v[ic];

// if dynamic phi road is enabled then compute the phi road for a cluster
// of energy of existing clusters + the candidate cluster.
if (dynamicPhiRoad_)
phiRoad = phiRoadAlgo_->endcapPhiRoad(energy + (currentCluster)->energy());

auto dphi = [](float p1,float p2) {
auto dp=std::abs(p1-p2); if (dp>float(M_PI)) dp-=float(2*M_PI);
return std::abs(dp);
};

auto match = [&](int i, int j) {
return (dphi(phi[i],phi[j])< phiRoad) & (std::abs(eta[i]-eta[j])< etaRoad);
};

// does the cluster match the phi road for this candidate supercluster
if (!usedSeed[ic] && match(is,ic)) {

// add basic cluster to supercluster constituents
constituentClusters.push_back(currentCluster);
energy += (currentCluster)->energy();
position_ += (currentCluster)->energy() * math::XYZVector((currentCluster)->position().X(),
(currentCluster)->position().Y(),
(currentCluster)->position().Z()
);
// remove cluster from vector of available clusters
usedSeed[ic]=true;
LogTrace("EcalClusters") << "Cluster R = " << (currentCluster)->position().Rho();
}
++ic;
}

position_ /= energy;

LogTrace("EcalClusters") <<"Final SuperCluster R = " << position_.Rho();

reco::SuperCluster newSuperCluster(energy,
math::XYZPoint(position_.X(), position_.Y(), position_.Z()),
currentSeed,
constituentClusters);

superclusters_v.push_back(newSuperCluster);
LogTrace("EcalClusters") << "created a new supercluster of: ";
LogTrace("EcalClusters") << "Energy = " << newSuperCluster.energy();
LogTrace("EcalClusters") << "Position in (R, phi, theta) = ("
<< newSuperCluster.position().Rho() << ", "
<< newSuperCluster.position().phi() << ", "
<< newSuperCluster.position().theta() << ")" ;


}

clusters_v.clear();

}
1 change: 1 addition & 0 deletions RecoJets/JetProducers/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<use name="DataFormats/CastorReco"/>
<use name="fastjet"/>
<use name="roottmva"/>
<use name="vdt"/>
<export>
<lib name="1"/>
</export>
1 change: 1 addition & 0 deletions RecoJets/JetProducers/interface/VirtualJetProducerHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace reco {
double intersection(double r12) ;
// Area of intersection of three unit-radius disks with centers separated by r12, r23, r13.
double intersection(double r12, double r23, double r13) ;
double intersection(double r12, double r23, double r13, double a12, double a23, double a13);
}
}
}
Expand Down

0 comments on commit 974d97a

Please sign in to comment.