-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update of the ALERT ATOF labeling for sector/layer/component (#260)
* Unused and confusing directory * Updated reading of the geometry (cf. PR389 in CJ) * Update for the indexing * Update bank description
- Loading branch information
Showing
12 changed files
with
73 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,12 +14,11 @@ import GeoArgParse | |
def variation = GeoArgParse.getVariation(args); | ||
def runNumber = GeoArgParse.getRunNumber(args); | ||
|
||
// not really used at the moment | ||
//Will be used when calibration constants are defined | ||
DatabaseConstantProvider cp = new DatabaseConstantProvider(runNumber, variation); | ||
//provider.loadTable("/geometry/cnd/cndgeom"); | ||
//ConstantProvider cp = GeometryFactory.getConstants(DetectorType.FTOF, runNumber, variation); | ||
|
||
//MYFactory_ATOF factory = new MYFactory_ATOF(); | ||
AlertTOFFactory factory = new AlertTOFFactory(); | ||
Detector atof = factory.createDetectorCLAS(cp); | ||
|
||
|
@@ -36,44 +35,48 @@ int nsectors = atof.getNumSectors(); | |
|
||
//double ATOF_Z_length = 279.7; // mm, atof paddles total lenght in z | ||
|
||
//15 ATOF sectors | ||
for(int isec=0; isec<nsectors; isec++) | ||
{ | ||
//Divided into SL=0/bottom/bar and SL=1/top/wedge | ||
int nsuperlayers = atof.getSector(isec).getNumSuperlayers(); | ||
for(int isl=0; isl<nsuperlayers; isl++) | ||
{ | ||
//Divided into 4 layers = quarters of sectors | ||
int nlayers = atof.getSector(isec).getSuperlayer(isl).getNumLayers(); | ||
for(int ilay=0; ilay<nlayers; ilay++) | ||
{ | ||
int ncomponents = atof.getSector(isec).getSuperlayer(isl).getLayer(ilay).getNumComponents(); | ||
//if(isec==0 && isl==0 && ilay==0) writer1 << "ahdc.layer.ncomponents | " << ncomponents << "\n"; | ||
//Components are z slices | ||
int ncomponents = atof.getSector(isec).getSuperlayer(isl).getLayer(ilay).getNumComponents(); | ||
if(ncomponents!=0) | ||
{ | ||
writer1 << "atof.sector" << isec << ".superlayer"<< isl << ".layer"<< ilay <<".ncomponents | " << ncomponents << "| na | number of counters in module | sergeyeva | [email protected] | none | none | 15 June 2020 \n"; | ||
|
||
for(int icomp=isec*4; icomp<isec*4+ncomponents; icomp++) | ||
if(isl==0) | ||
{ | ||
//Bottom bar not sliced in z index=10 | ||
Component comp = atof.getSector(isec).getSuperlayer(isl).getLayer(ilay).getComponent(10); | ||
writer2<< gemcString(isec, isl, ilay, comp); | ||
} | ||
else | ||
{ | ||
Component comp = atof.getSector(isec).getSuperlayer(isl).getLayer(ilay).getComponent(icomp); | ||
writer2<< gemcString(isec, isl, ilay, comp); | ||
for(int icomp=0; icomp<ncomponents; icomp++) | ||
{ | ||
//Top wedge has 10 z slices | ||
Component comp = atof.getSector(isec).getSuperlayer(isl).getLayer(ilay).getComponent(icomp); | ||
writer2<< gemcString(isec, isl, ilay, comp); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
writer1.close(); | ||
writer2.close(); | ||
|
||
// need to be updated with correct format for trapezoide | ||
public String gemcString(int sector, int superlayer,int layer, Component comp) { | ||
StringBuilder str = new StringBuilder(); | ||
/* | ||
for (int ip = 0; ip < comp.getNumVolumePoints(); ip++) { | ||
Point3D p = comp.getVolumePoint(ip); | ||
str.append(String.format("%14.6f*cm | %14.6f*cm | %14.6f*cm ||", p.x(), p.y(), p.z())); | ||
} | ||
*/ | ||
|
||
// reading top face vertices of ATOF cell and storing their x,y coordinates | ||
Point3D p0 = comp.getVolumePoint(0); | ||
double top_x_0 = p0.x(); | ||
|
@@ -102,11 +105,8 @@ public String gemcString(int sector, int superlayer,int layer, Component comp) { | |
double bottom_y_7 = p7.y(); | ||
|
||
// component name should be added | ||
str.append(String.format("sector%d_superlayer%d_layer%d_paddle%d | root", sector, superlayer, layer, (comp.getComponentId()+1))); | ||
|
||
// Giving the origin point of coordinate system in which the trapezoide vertices are defined | ||
//str.append(String.format("| %8.4f*mm %8.4f*mm %8.4f*mm | ", 0.0, 0.0, ((comp.getLine().midpoint().z()-15.0)-150.0+15.0))); // in mm | ||
|
||
str.append(String.format("sector%d_superlayer%d_layer%d_paddle%d | root", sector, superlayer, layer, (comp.getComponentId()))); | ||
|
||
if(superlayer == 0) | ||
{ | ||
str.append(String.format("| %8.4f*mm %8.4f*mm %8.4f*mm | ", 0.0, 0.0, ((comp.getLine().midpoint().z() - 279.7/2)))); // in mm | ||
|
@@ -138,19 +138,19 @@ public String gemcString(int sector, int superlayer,int layer, Component comp) { | |
|
||
// need to be corrected according to geant4 volume definition | ||
|
||
str.append(String.format("%14.6f*mm %14.6f*mm ", top_x_0, top_y_0)); | ||
str.append(String.format("%14.6f*mm %14.6f*mm ", top_x_1, top_y_1)); | ||
str.append(String.format("%14.6f*mm %14.6f*mm ", top_x_2, top_y_2)); | ||
str.append(String.format("%14.6f*mm %14.6f*mm ", top_x_3, top_y_3)); | ||
str.append(String.format("%14.6f*mm %14.6f*mm ", top_x_0, top_y_0)); | ||
str.append(String.format("%14.6f*mm %14.6f*mm ", top_x_1, top_y_1)); | ||
str.append(String.format("%14.6f*mm %14.6f*mm ", top_x_2, top_y_2)); | ||
str.append(String.format("%14.6f*mm %14.6f*mm ", top_x_3, top_y_3)); | ||
|
||
str.append(String.format("%14.6f*mm %14.6f*mm ", bottom_x_4, bottom_y_4)); | ||
str.append(String.format("%14.6f*mm %14.6f*mm ", bottom_x_5, bottom_y_5)); | ||
str.append(String.format("%14.6f*mm %14.6f*mm ", bottom_x_6, bottom_y_6)); | ||
str.append(String.format("%14.6f*mm %14.6f*mm ", bottom_x_7, bottom_y_7)); | ||
|
||
str.append(String.format("%14.6f*mm %14.6f*mm ", bottom_x_4, bottom_y_4)); | ||
str.append(String.format("%14.6f*mm %14.6f*mm ", bottom_x_5, bottom_y_5)); | ||
str.append(String.format("%14.6f*mm %14.6f*mm ", bottom_x_6, bottom_y_6)); | ||
str.append(String.format("%14.6f*mm %14.6f*mm ", bottom_x_7, bottom_y_7)); | ||
// currently only writing the component id but should save all necessary identifiers according to detector definition | ||
str.append(" | "); | ||
str.append(String.format("%d %d %d %d", sector, superlayer, layer, (comp.getComponentId()+1))); | ||
str.append(String.format("%d %d %d %d", sector, superlayer, layer, (comp.getComponentId()))); | ||
|
||
str.append("\n"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.