Skip to content
Snippets Groups Projects
Commit 58a86fa1 authored by Petr Jacka's avatar Petr Jacka
Browse files

Removed not needed code from CaloGeometryFromFile

Former-commit-id: d2e22aac6acf02aae7d582b052665decd75c2ad8
parent 0600f083
No related merge requests found
......@@ -115,7 +115,7 @@ bool CaloGeometryFromFile::LoadGeometryFromFile(TString filename,TString treenam
int sampling = pcell->getSampling();
if(sampling >20) continue;
//if(sampling >20) continue;
this->addcell(pcell);
if(jentry%25000==0) {
......@@ -168,173 +168,6 @@ bool CaloGeometryFromFile::LoadGeometryFromFile(TString filename,TString treenam
return ok;
}
void CaloGeometryFromFile::LoadFCalGeometryFromFiles(TString filename1,TString filename2,TString filename3){
vector<ifstream*> electrodes(3);
electrodes[0]=new ifstream(filename1);
electrodes[1]=new ifstream(filename2);
electrodes[2]=new ifstream(filename3);
int thisTubeId;
int thisTubeI;
int thisTubeJ;
//int thisTubeID;
//int thisTubeMod;
double thisTubeX;
double thisTubeY;
TString tubeName;
//int second_column;
string seventh_column;
string eight_column;
int ninth_column;
int i;
for(int imodule=1;imodule<=3;imodule++){
i=0;
//while(i<50){
while(1){
//cout << electrodes[imodule-1]->eof() << endl;
(*electrodes[imodule-1]) >> tubeName;
if(electrodes[imodule-1]->eof())break;
(*electrodes[imodule-1]) >> thisTubeId; // ?????
(*electrodes[imodule-1]) >> thisTubeI;
(*electrodes[imodule-1]) >> thisTubeJ;
(*electrodes[imodule-1]) >> thisTubeX;
(*electrodes[imodule-1]) >> thisTubeY;
(*electrodes[imodule-1]) >> seventh_column;
(*electrodes[imodule-1]) >> eight_column;
(*electrodes[imodule-1]) >> ninth_column;
tubeName.ReplaceAll("'","");
string tubeNamestring=tubeName.Data();
std::istringstream tileStream1(std::string(tubeNamestring,1,1));
std::istringstream tileStream2(std::string(tubeNamestring,3,2));
std::istringstream tileStream3(std::string(tubeNamestring,6,3));
int a1=0,a2=0,a3=0;
if (tileStream1) tileStream1 >> a1;
if (tileStream2) tileStream2 >> a2;
if (tileStream3) tileStream3 >> a3;
//unsigned int tileName= (a3 << 16) + a2;
stringstream s;
m_FCal_ChannelMap.add_tube(tubeNamestring, imodule, thisTubeId, thisTubeI,thisTubeJ, thisTubeX, thisTubeY,seventh_column);
//cout << "FCal electrodes: " << tubeName << " " << second_column << " " << thisTubeI << " " << thisTubeJ << " " << thisTubeX << " " << thisTubeY << " " << seventh_column << " " << eight_column << " " << ninth_column << endl;
//cout << tileStream1.str() << " " << tileStream2.str() << " " << tileStream3.str() << endl;
//cout << a1 << " " << a2 << " " << a3 << " " << tileName << endl;
i++;
}
}
m_FCal_ChannelMap.finish(); // Creates maps
unsigned long long phi_index,eta_index;
float x,y,dx,dy;
long id;
//auto it =m_cells_in_sampling[20].rbegin();
//it--;
//unsigned long long identify=it->first;
//for(auto it=m_cells_in_sampling[i].begin(); it!=m_cells_in_sampling[i].end();it++){
//
//}
long mask1[]{0x34,0x34,0x35};
long mask2[]{0x36,0x36,0x37};
for(int imap=1;imap<=3;imap++){
for(auto it=m_FCal_ChannelMap.begin(imap);it!=m_FCal_ChannelMap.end(imap);it++){
phi_index = it->first & 0xffff;
eta_index = it->first >> 16;
CaloDetDescrElement *DDE =new CaloDetDescrElement; // side C
CaloDetDescrElement *DDE2 =new CaloDetDescrElement; // side A
x=it->second.x();
y=it->second.y();
m_FCal_ChannelMap.tileSize(imap, eta_index, phi_index,dx,dy);
//if(imap==2) eta_index+=100;
//if(imap==3) eta_index+=200;
//cout << imap << " " << eta_index << " " << phi_index << " " << it->first << " " << (eta_index << 16) + phi_index << endl;
DDE->m_calosample=imap+20;
DDE->m_x=x;
DDE->m_y=y;
DDE->m_x_raw=x;
DDE->m_y_raw=y;
DDE->m_dx=dx;
DDE->m_dy=dy;
DDE2->m_calosample=imap+20;
DDE2->m_x=x;
DDE2->m_y=y;
DDE2->m_x_raw=x;
DDE2->m_y_raw=y;
DDE2->m_dx=dx;
DDE2->m_dy=dy;
id=(mask1[imap-1]<<12) + (eta_index << 5) +2*phi_index;
if(imap==2) id+= (8<<8);
DDE->m_identify=(id << 44);
//DDE->m_identify=(id << 12);
//cout << DDE->identify() << endl;
if (g_cellId_vs_cellHashId_map.find(DDE->m_identify)!=g_cellId_vs_cellHashId_map.end()) DDE->m_hash_id=g_cellId_vs_cellHashId_map[DDE->m_identify];
else cout << endl << "ERROR: Cell id not found in the cellId_vs_cellHashId_map!!!" << endl << endl;
addcell(DDE);
id=(mask2[imap-1]<<12) + (eta_index << 5) +2*phi_index;
if(imap==2) id+= (8<<8);
DDE2->m_identify=(id << 44);
//DDE->m_identify=(id << 12);
if (g_cellId_vs_cellHashId_map.find(DDE2->m_identify)!=g_cellId_vs_cellHashId_map.end()) DDE2->m_hash_id=g_cellId_vs_cellHashId_map[DDE2->m_identify];
else cout << endl << "ERROR: Cell id not found in the cellId_vs_cellHashId_map!!!" << endl << endl;
addcell(DDE2);
delete DDE;
delete DDE2;
}
}
//auto it =m_cells_in_sampling[0].begin();
//it--;
//unsigned long long identify=it->first;
////cout << "min identifier from sampling < 21: " << identify << endl;
//for(int i=0;i<21;++i) {
////for(int i=21;i<MAX_SAMPLING;++i) {
//cout<<" cells sampling "<<i<<" : "<<m_cells_in_sampling[i].size()<<" cells";
//cout<<", "<<m_cells_in_regions[i].size()<<" lookup map(s)"<<endl;
//int k=0;
//for(auto it=m_cells_in_sampling[i].begin(); it!=m_cells_in_sampling[i].end();it++){
//if(k<10){
//cout << " cells sampling "<< it->second->getSampling() << " : " << it->first << endl;
//const CaloDetDescrElement *DDE = this->getDDE(it->second->getSampling(),it->second->eta(),it->second->phi());
//cout << " cells sampling "<< DDE->getSampling() << " : " << DDE->identify() << endl;
//DDE = this->getDDE(it->first);
//cout << " cells sampling "<< DDE->getSampling() << " : " << DDE->identify() << endl << endl;
//}
//k++;
//}
//}
for(int imodule=1;imodule<=3;imodule++) delete electrodes[imodule-1];
electrodes.clear();
}
void CaloGeometryFromFile::DrawFCalGraph(int isam,int color){
stringstream ss;
......
......@@ -14,7 +14,6 @@ public :
virtual ~CaloGeometryFromFile();
virtual bool LoadGeometryFromFile(TString filename,TString treename,TString hashfile="/afs/cern.ch/atlas/groups/Simulation/FastCaloSimV2/cellId_vs_cellHashId_map.txt");
virtual void LoadFCalGeometryFromFiles(TString filename1,TString filename2,TString filename3);
void DrawFCalGraph(int isam,int color);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment