Skip to content

Commit

Permalink
quiet all the couts
Browse files Browse the repository at this point in the history
  • Loading branch information
lgray committed Nov 27, 2015
1 parent ea1ca61 commit 1383ada
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ std::pair<float,DetId> EcalBarrelClusterFastTimer::getTimeForECALPFCluster(const
best_time_guess = timehits.find(best_hit)->time();
}

std::cout << "EcalBarrelFastTimer: " << best_time_guess << ' ' << best_energy << ' ' << best_hit << std::endl;
//std::cout << "EcalBarrelFastTimer: " << best_time_guess << ' ' << best_energy << ' ' << best_hit << std::endl;

return std::make_pair(best_time_guess,DetId(best_hit));
}
Expand All @@ -211,8 +211,10 @@ float EcalBarrelClusterFastTimer::correctTimeToVertex(const float intime, const
const math::XYZVector to_center = layerPos_cm - math::XYZPoint(0.,0.,0.);
const math::XYZVector to_vtx = layerPos_cm - vtx.position();

/*
std::cout << intime << ' ' << to_center.r()/cm_per_ns << ' ' << to_vtx.r()/cm_per_ns
<< ' ' << intime + to_center.r()/cm_per_ns - to_vtx.r()/cm_per_ns << std::endl;
*/

return intime + to_center.r()/cm_per_ns - to_vtx.r()/cm_per_ns;
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ void TrackTimeValueMapProducer::calculateTrackTimes( const edm::View<reco::Track
} else {

const std::pair<float,float> time_info = extractTrackVertexTime(track_tps->val);
std::cout << "track z = " << tkref->vz() << " +/- " << tkref->dzError() << " cm ,";
std::cout << " sim vertex z = " << time_info.second << " t = " << time_info.first;
std::cout << std::endl;
//std::cout << "track z = " << tkref->vz() << " +/- " << tkref->dzError() << " cm ,";
//std::cout << " sim vertex z = " << time_info.second << " t = " << time_info.first;
//std::cout << std::endl;
tvals.push_back(time_info.first);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,8 @@ def cust_2023HGCalPandoraMuonFastTime(process):
process.load("RecoParticleFlow.FastTiming.ecalBarrelClusterFastTimer_cfi")
process.offlinePrimaryVertices1D = process.offlinePrimaryVertices.clone()
process.offlinePrimaryVertices1D.TkFilterParameters.minPt = cms.double(1.0)
process.offlinePrimaryVertices4D = process.offlinePrimaryVertices.clone( verbose = cms.untracked.bool(True), TkClusParameters = process.DA2DParameters )
process.offlinePrimaryVertices4D = process.offlinePrimaryVertices.clone( verbose = cms.untracked.bool(False), TkClusParameters = process.DA2DParameters )
process.offlinePrimaryVertices4D.TkFilterParameters.minPt = cms.double(1.0)
process.particleFlowReco = cms.Sequence(process.trackTimeValueMapProducer+process.offlinePrimaryVertices1D+process.offlinePrimaryVertices4D+process.particleFlowReco)
process.RandomNumberGeneratorService.trackTimeValueMapProducer = cms.PSet(
initialSeed = cms.untracked.uint32(1234), engineName = cms.untracked.string('TRandom3')
Expand Down Expand Up @@ -454,7 +455,8 @@ def cust_2023HGCalPandoraMuonPerfectFastTime(process):
process.load("RecoParticleFlow.FastTiming.ecalBarrelClusterFastTimer_cfi")
process.offlinePrimaryVertices1D = process.offlinePrimaryVertices.clone()
process.offlinePrimaryVertices1D.TkFilterParameters.minPt = cms.double(1.0)
process.offlinePrimaryVertices4D = process.offlinePrimaryVertices.clone( verbose = cms.untracked.bool(True), TkClusParameters = process.DA2DParameters )
process.offlinePrimaryVertices4D = process.offlinePrimaryVertices.clone( verbose = cms.untracked.bool(False), TkClusParameters = process.DA2DParameters )
process.offlinePrimaryVertices4D.TkFilterParameters.minPt = cms.double(1.0)
process.particleFlowReco = cms.Sequence(process.trackTimeValueMapProducer+process.offlinePrimaryVertices1D+process.offlinePrimaryVertices4D+process.particleFlowReco)
process.RandomNumberGeneratorService.trackTimeValueMapProducer = cms.PSet(
initialSeed = cms.untracked.uint32(1234), engineName = cms.untracked.string('TRandom3')
Expand Down
26 changes: 13 additions & 13 deletions RecoVertex/AdaptiveVertexFit/src/AdaptiveVertexFitter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,16 @@ AdaptiveVertexFitter::vertex(const vector<reco::TransientTrack> & unstracks) con
sort ( tracks.begin(), tracks.end(), CompareTwoTracks() );
// Linearization Point
GlobalPoint linP = theLinP->getLinearizationPoint(tracks);
std::cout << "linearized point: " << linP << std::endl;
//std::cout << "linearized point: " << linP << std::endl;
// Initial vertex seed, with a very large error matrix
std::cout << "setup vertex seed state" << std::endl;
//std::cout << "setup vertex seed state" << std::endl;
VertexState lseed (linP, linPointError() );
std::cout << lseed.error4D().matrix4D() << std::endl;
//std::cout << lseed.error4D().matrix4D() << std::endl;
vector<RefCountedVertexTrack> vtContainer = linearizeTracks(tracks, lseed);

std::cout << "fit start" << std::endl;
//std::cout << "fit start" << std::endl;
VertexState seed (linP, fitError() );
std::cout << seed.error4D().matrix4D() << std::endl;
//std::cout << seed.error4D().matrix4D() << std::endl;
return fit(vtContainer, seed, false);
}

Expand Down Expand Up @@ -528,7 +528,7 @@ AdaptiveVertexFitter::fit( const vector<RefCountedVertexTrack> & tracks,
const VertexState & priorSeed,
bool withPrior) const
{
std::cout << "[AdaptiveVertexFit] fit with " << tracks.size() << endl;
//std::cout << "[AdaptiveVertexFit] fit with " << tracks.size() << endl;
theAssProbComputer->resetAnnealing();

vector<RefCountedVertexTrack> initialTracks;
Expand Down Expand Up @@ -561,29 +561,29 @@ AdaptiveVertexFitter::fit( const vector<RefCountedVertexTrack> & tracks,
int ns_trks=0; // number of significant tracks.
// If we have only two significant tracks, we return an invalid vertex

std::cout << "[AdaptiveVertexFit] start " << tracks.size() << endl;
//std::cout << "[AdaptiveVertexFit] start " << tracks.size() << endl;

for ( vector< RefCountedVertexTrack >::const_iterator
i=globalVTracks.begin(); i!=globalVTracks.end() ; ++i )
{
std::cout << " mom=" << (**i).linearizedTrack()->track().initialFreeState().momentum() << endl;
std::cout << " pos=" << (**i).linearizedTrack()->track().initialFreeState().position() << endl;
//std::cout << " mom=" << (**i).linearizedTrack()->track().initialFreeState().momentum() << endl;
//std::cout << " pos=" << (**i).linearizedTrack()->track().initialFreeState().position() << endl;
}
do {
ns_trks=0;
CachingVertex<5> fVertex = initialVertex;
std::cout << "[AdaptiveVertexFit] step " << step << " at " << fVertex.position() << endl;
//std::cout << "[AdaptiveVertexFit] step " << step << " at " << fVertex.position() << endl;
if ((previousPosition - newPosition).transverse() > theMaxLPShift)
{
// relinearize and reweight.
// (reLinearizeTracks also reweights tracks)
std::cout << "[AdaptiveVertexFit] relinearize at " << returnVertex.position() << endl;
//std::cout << "[AdaptiveVertexFit] relinearize at " << returnVertex.position() << endl;
if (gsfIntermediarySmoothing_) returnVertex = theSmoother->smooth(returnVertex);
globalVTracks = reLinearizeTracks( globalVTracks, returnVertex );
lpStep++;
} else if (step) {
// reweight, if it is not the first step
std::cout << "[AdaptiveVertexFit] reweight at " << returnVertex.position() << endl;
//std::cout << "[AdaptiveVertexFit] reweight at " << returnVertex.position() << endl;
if (gsfIntermediarySmoothing_) returnVertex = theSmoother->smooth(returnVertex);
globalVTracks = reWeightTracks( globalVTracks, returnVertex );
}
Expand Down Expand Up @@ -643,7 +643,7 @@ AdaptiveVertexFitter::fit( const vector<RefCountedVertexTrack> & tracks,
for ( vector< RefCountedVertexTrack >::const_iterator
i=globalVTracks.begin(); i!=globalVTracks.end() ; ++i )
{
std::cout << " wgt=" << (**i).weight() << std::endl;
//std::cout << " wgt=" << (**i).weight() << std::endl;
}
edm::LogInfo("AdaptiveVertexFitter")
<< "fewer than two significant tracks (w>" << theWeightThreshold << ")."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,15 @@ PrimaryVertexProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup
time = 0.0;
timeReso = 1.0;
}
std::cout << time << ' ' << timeReso << std::endl;
//std::cout << time << ' ' << timeReso << std::endl;
reco::TransientTrack temptt(temp.castTo<reco::TrackRef>(),time,timeReso,
theB->field(),theB->trackingGeometry());
seltk.swap(temptt);
/*
std::cout << seltk.track().pt() << ' '
<< seltk.timeExt() << ' '
<< seltk.dtErrorExt() << std::endl;
*/
}
}

Expand Down Expand Up @@ -232,9 +234,9 @@ PrimaryVertexProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup
v = algorithm->fitter->vertex(*iclus, beamSpot);

if( f4D ) {
std::cout << "beamspot constrained thingy" << std::endl;
//std::cout << "beamspot constrained thingy" << std::endl;
auto err = v.positionError().matrix4D();
std::cout << "got the error" << std::endl;
//std::cout << "got the error" << std::endl;
err(3,3) = time_var/(double)iclus->size();
v = TransientVertex(v.position(),meantime,err,v.originalTracks(),v.totalChiSquared());
}
Expand All @@ -244,9 +246,9 @@ PrimaryVertexProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup
v = algorithm->fitter->vertex(*iclus);

if( f4D ) {
std::cout << "beamspot constrained thingy" << std::endl;
//std::cout << "beamspot constrained thingy" << std::endl;
auto err = v.positionError().matrix4D();
std::cout << "got the error" << std::endl;
//std::cout << "got the error" << std::endl;
err(3,3) = time_var/(double)iclus->size();
v = TransientVertex(v.position(),meantime,err,v.originalTracks(),v.totalChiSquared());
}
Expand Down
2 changes: 1 addition & 1 deletion RecoVertex/PrimaryVertexProducer/src/DAClusterizerInZT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ DAClusterizerInZT::fill( const vector<reco::TransientTrack> & tracks )const{
+ (std::pow(beamspot.BeamWidthX()*cos(phi),2.)+std::pow(beamspot.BeamWidthY()*sin(phi),2.))/std::pow(tantheta,2.) // beam-width induced
+ std::pow(vertexSize_,2); // intrinsic vertex size, safer for outliers and short lived decays

std::cout << "got transient track with time = " << it->timeExt() << " +/- " << it->dtErrorExt() << " ns"<< std::endl;
//std::cout << "got transient track with time = " << it->timeExt() << " +/- " << it->dtErrorExt() << " ns"<< std::endl;

t.t = it->timeExt(); // the time
t.dtz = 0.;
Expand Down

0 comments on commit 1383ada

Please sign in to comment.