Commit 56a842ec authored by Luca Mastrolorenzo's avatar Luca Mastrolorenzo

Add some methods to the C3d class in order to study the shared energy +...

Add some methods to the C3d class in order to study the shared energy + addition of the C3d-BackToFront clustering method
parent 9985770a
This diff is collapsed.
......@@ -1284,17 +1284,18 @@ double Event::fTrgHitSelectorMipsCut=5.0;
unsigned Event::fTrgC2dCreatorMethod=4; /*near neighbours (version 3)*/
unsigned Event::fTrgC3dCreatorMethod=2; /* eta phi clustering */
unsigned Event::fTrgC3dCreatorMethod=2; /* xyNorm front-back clustering */
//unsigned Event::fTrgC3dCreatorMethod=3; /* xyNorm back-front clustering */
/* energy thr for 2d clustering (in mips) */
double Event::fENERGY_CUT_Et = 15.;
double Event::fSEED_ENERGY_CUT_Et = 5.;
double Event::fENERGY_CUT_Et = 5.;
double Event::fSEED_ENERGY_CUT_Et = 15.;
//Luca modif below
//double Event::fENERGY_CUT_Et = 10.;
//double Event::fSEED_ENERGY_CUT_Et = 15.;
double Event::fENERGY_CUT = 25.;
double Event::fSEED_ENERGY_CUT = 10.;
double Event::fENERGY_CUT = 10.;
double Event::fSEED_ENERGY_CUT = 25.;
/* cut in normalized coordinate for 3d clustering */
double Event::fNormCooCut = .01;
......
......@@ -246,7 +246,57 @@ public:
return SharedMipT;
}
std::vector<double> C3dSharedC2dLayer( TrgC3d *Clu3d ){
std::vector<double> vSharedC2dLayer;
std::vector<TrgC2d*> extV = Clu3d->trgC2ds();
for(unsigned i(0); i<extV.size(); i++ ){
for(unsigned j(0); j<vTrgC2d.size(); j++ ){
if( vTrgC2d[j]->getUniqueId() == extV[i]->getUniqueId() ){
vSharedC2dLayer.push_back(vTrgC2d[j]->layer());
}
}
}
return vSharedC2dLayer;
}
std::vector<double> C3dNotSharedC2dLayer( TrgC3d *Clu3d ){
std::vector<double> vNotSharedC2dLayer;
std::vector<TrgC2d*> extV = Clu3d->trgC2ds();
bool hasAtLeastOneC2dShared=false;
for(unsigned i(0); i<extV.size(); i++ ){
for(unsigned j(0); j<vTrgC2d.size(); j++ ){
if( vTrgC2d[j]->getUniqueId() == extV[i]->getUniqueId() ){
hasAtLeastOneC2dShared=true;
}
}
}
if( hasAtLeastOneC2dShared==true){
for(unsigned i(0); i<extV.size(); i++ ){
for(unsigned j(0); j<vTrgC2d.size(); j++ ){
if( vTrgC2d[j]->getUniqueId() != extV[i]->getUniqueId() ){
vNotSharedC2dLayer.push_back(vTrgC2d[j]->layer());
}
}
}
}
return vNotSharedC2dLayer;
}
int LayerGapInC3d(){
int gapInC3d = 0;
std::vector<int> vGap_tmp;
for(unsigned i(0); i<vTrgC2d.size(); i++ ){
if(i=vTrgC2d.size()-1) break;
if(vTrgC2d[i+1]->layer() - vTrgC2d[i]->layer() != 1) continue;
else{
gapInC3d = (vTrgC2d[i+1]->layer() - vTrgC2d[i]->layer());
vGap_tmp.push_back(gapInC3d);
}
}
std::sort( vGap_tmp.begin(), vGap_tmp.end() );
return vGap_tmp.back();
}
Point position() const {
......
......@@ -39,7 +39,7 @@ double calibCluster(double dep[]){
//E += dep[i] * MaxCluCoeffGamma_26l_PU200_3[i];
E += dep[i] * MaxCluCoeffPi_26l_PU200[i];
std::cout << " dep[i]*a[i] = " << dep[i] <<" * " << MaxCluCoeffPi_26l_PU200[i] << " = " <<E << std::endl;
//std::cout << " dep[i]*a[i] = " << dep[i] <<" * " << MaxCluCoeffPi_26l_PU200[i] << " = " <<E << std::endl;
}
return E;
}
......@@ -136,6 +136,45 @@ void trgC3dCreator() {
} // method 2
if( Event::fTrgC3dCreatorMethod == 3 ){
for(unsigned e(0);e<Geometry::kNumberOfEndcaps;e++) {
vTrgC3d[e].resize(0);
// for(unsigned l(0); l<Geometry::kNumberOfLayers; l++) { // front 2 back
for(int l=(Geometry::kNumberOfLayers-1); l>-1; l--) { // back 2 front
//std::cout << "layer "<<l << std::endl;
for( unsigned iC2d = 0; iC2d<vTrgC2d[e][l].size(); iC2d++ ) {
bool C2dAdded=false;
for(unsigned iC3d=0; iC3d<vTrgC3d[e].size(); iC3d++){
//if( vTrgC3d[e][iC3d].C2dDistanceNorm( vTrgC2d[e][l][iC2d].centerNorm() ) < fNormCooCut ){
if( vTrgC3d[e][iC3d].C2dDistanceNorm( vTrgC2d[e][l][iC2d].centerNorm() ) < fNormCooCut ){
C2dAdded=true;
vTrgC3d[e][iC3d].addTrgC2d( &(vTrgC2d[e][l][iC2d]) );
}
}
if( !C2dAdded ){
vTrgC3d[e].push_back( TrgC3d() );
vTrgC3d[e].back().setEndcap(e);
vTrgC3d[e].back().addTrgC2d( &(vTrgC2d[e][l][iC2d]) );
}
}
}// layer
}// endcap
} // method 3
//org for(unsigned e(0);e<Geometry::kNumberOfEndcaps;e++) {
//org hXY3d->Reset();
//org
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment