Commit 64510062 authored by vpalladi's avatar vpalladi

Added new metho for 3d clustering (Method 4). This method doesn't allow for 2d...

Added new metho for 3d clustering (Method 4). This method doesn't allow for 2d cluster duplication in a 3d cluster. For more info got to interface/trgC3dCreator.hh
parent 0654ef58
......@@ -287,8 +287,10 @@ public:
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;
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);
......
......@@ -3,7 +3,10 @@ void trgC3dCreator() {
std::cout << "Calling Event::trgC3dCreator() with method "
<< Event::fTrgC3dCreatorMethod << std::endl;
/* Method 0
This method starts form a given layer (layerSeed) to start the 3D-cluster (the layerSeed contaitns all the 2D clusters that will start a 3d Cluster).
TC is added to the 3D cluster if
*/
if( Event::fTrgC3dCreatorMethod == 0 ){
for(unsigned e(0);e<Geometry::kNumberOfEndcaps;e++) {
......@@ -40,9 +43,15 @@ void trgC3dCreator() {
}
} // method 0
/* Method 1
DO NOT USE this method is usable only for visualization
*/
if( Event::fTrgC3dCreatorMethod == 1 ){
for(unsigned e(0);e<Geometry::kNumberOfEndcaps;e++) {
vTrgC3d[e].resize(0);
......@@ -102,6 +111,11 @@ void trgC3dCreator() {
} // method 1
/* Method 2
Starts for layer 0 and create a 3d cluster from any 2d cluster that is not added to a previous 3d cluster. This method allows for duplicaiton of 2d clusters in a 3d cluster.
*/
if( Event::fTrgC3dCreatorMethod == 2 ){
......@@ -137,7 +151,11 @@ void trgC3dCreator() {
} // method 2
/* Method 3
The same as Method 2 but starting from the back of hte claorimeter.
*/
if( Event::fTrgC3dCreatorMethod == 3 ){
......@@ -152,7 +170,6 @@ void trgC3dCreator() {
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]) );
......@@ -175,6 +192,64 @@ void trgC3dCreator() {
} // method 3
/* Method 4
Starts for layer 0 and create a 3d cluster from any d cluster that is not added to a previous 3d cluster.
This method DOES NOT allow for duplicaiton of 2d clusters in a 3d cluster. In case a 2d cluster could be added to more than one 3d cluster the closest 3d cluster is considered.
*/
if( Event::fTrgC3dCreatorMethod == 4 ){
for(unsigned e(0);e<Geometry::kNumberOfEndcaps;e++) {
vTrgC3d[e].resize(0);
for(unsigned l(0); l<Geometry::kNumberOfLayers; l++) {
for( unsigned iC2d = 0; iC2d<vTrgC2d[e][l].size(); iC2d++ ) {
vector<int> C3DsToAdd;
for(unsigned iC3d=0; iC3d<vTrgC3d[e].size(); iC3d++){
if( vTrgC3d[e][iC3d].C2dDistanceNorm( vTrgC2d[e][l][iC2d].centerNorm() ) < fNormCooCut ){
C3DsToAdd.push_back(iC3d);
// vTrgC3d[e][iC3d].addTrgC2d( &(vTrgC2d[e][l][iC2d]) );
}
}
// if( !C2dAdded ){
if( C3DsToAdd.size() == 0 ) {
vTrgC3d[e].push_back( TrgC3d() );
vTrgC3d[e].back().setEndcap(e);
vTrgC3d[e].back().addTrgC2d( &(vTrgC2d[e][l][iC2d]) );
}
else{
int C3DtoAdd = C3DsToAdd.at(0);
double C3DtoC2Ddistance = vTrgC3d[e][C3DtoAdd].C2dDistanceNorm( vTrgC2d[e][l][iC2d].centerNorm() );
for(vector<int>::iterator C3d=C3DsToAdd.begin(); C3d != C3DsToAdd.end(); C3d++){
double newDistance = vTrgC3d[e][*C3d].C2dDistanceNorm( vTrgC2d[e][l][iC2d].centerNorm() );
if( C3DtoC2Ddistance > newDistance ){
C3DtoC2Ddistance = newDistance;
C3DtoAdd = *C3d;
}
}
vTrgC3d[e][C3DtoAdd].addTrgC2d( &(vTrgC2d[e][l][iC2d]) ); // adding the C2d to the closest C3d
}
}
}// layer
}// endcap
} // method 4
//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