18 #include <QMessageBox> 
   20 #include <Inventor/SoPath.h> 
   21 #include <Inventor/nodes/SoSeparator.h> 
   22 #include <Inventor/nodes/SoMaterial.h> 
   24 #include "CaloDetDescr/CaloDetDescrElement.h" 
   41 #include "GaudiKernel/ISvcLocator.h" 
   42 #include "GaudiKernel/Bootstrap.h" 
   43 #include "GaudiKernel/IToolSvc.h" 
  183     if(mbtsHelper) 
delete mbtsHelper;
 
  190             controller->energyModeEt(),controller->scale(),
 
  191             controller->showVolumeOutLines(),controller->globalCuts());
 
  193             controller->energyModeEt(),controller->scale(),
 
  194             controller->showVolumeOutLines(),controller->globalCuts());
 
  196             controller->energyModeEt(),controller->scale(),
 
  197             controller->showVolumeOutLines(),controller->globalCuts());
 
  199             controller->energyModeEt(),controller->scale(),
 
  200             controller->showVolumeOutLines(),controller->globalCuts());
 
  202             controller->energyModeEt(),controller->scale(),
 
  203             controller->showVolumeOutLines(),controller->globalCuts());
 
  205             controller->energyModeEt(),controller->scale(),
 
  206             controller->showVolumeOutLines(),controller->globalCuts());
 
  208             controller->energyModeEt(),controller->scale(),
 
  209             controller->showVolumeOutLines(),controller->globalCuts());
 
  211             controller->energyModeEt(),controller->scale(),
 
  212             controller->showVolumeOutLines(),controller->globalCuts());
 
  214             controller->energyModeEt(),controller->scale(),
 
  215             controller->showVolumeOutLines(),controller->globalCuts());
 
  217             controller->energyModeEt(),controller->scale(),
 
  218             controller->showVolumeOutLines(),controller->globalCuts());
 
  220             controller->energyModeEt(),controller->scale(),
 
  221             controller->showVolumeOutLines(),controller->globalCuts());
 
  223             controller->energyModeEt(),controller->scale(),
 
  224             controller->showVolumeOutLines(),controller->globalCuts());
 
  226             controller->energyModeEt(),controller->scale(),
 
  227             controller->showVolumeOutLines(),controller->globalCuts());
 
  229             controller->energyModeEt(),controller->scale(),
 
  230             controller->showVolumeOutLines(),controller->globalCuts());
 
  232             controller->energyModeEt(),controller->scale(),
 
  233             controller->showVolumeOutLines(),controller->globalCuts());
 
  235             controller->energyModeEt(),controller->scale(),
 
  236             controller->showVolumeOutLines(),controller->globalCuts());
 
  238             controller->energyModeEt(),controller->scale(),
 
  239             controller->showVolumeOutLines(),controller->globalCuts());
 
  241             controller->energyModeEt(),controller->scale(),
 
  242             controller->showVolumeOutLines(),controller->globalCuts());
 
  248         connect(controller,SIGNAL(scaleChanged(QPair<bool,double>)),
 
  249                 it->second,SLOT(scaleUpdated(QPair<bool,double>)));
 
  250         connect(controller,SIGNAL(showVolumeOutLinesChanged(
bool)),
 
  251                 it->second,SLOT(outlineUpdated(
bool)));
 
  254         connect(controller->customTourEditor(),SIGNAL(clipVolumeRadiusChanged(
double)),
 
  255                 it->second,SLOT(clipVolumeRadiusChanged(
double)));
 
  262     if(!calocells) 
return;
 
  271             if(calo_id->is_em_barrel(
cell->ID())) {
 
  275                 switch(calo_id->sampling(
cell->ID())) {
 
  293                   delete embCC; embCC=
nullptr;
 
  299             else if(calo_id->is_em_endcap(
cell->ID()) || calo_id->is_hec(
cell->ID())) {
 
  302                 if(calo_id->is_em_endcap(
cell->ID())) {
 
  304                     switch(calo_id->sampling(
cell->ID())) {
 
  322                       delete emechecCC; emechecCC=
nullptr;
 
  329                     switch(calo_id->sampling(
cell->ID())) {
 
  347                       delete emechecCC; emechecCC=
nullptr;
 
  354             else if(calo_id->is_fcal(
cell->ID())) {
 
  358                 switch(calo_id->sampling(
cell->ID())) {
 
  372                       delete fcalCC; fcalCC=
nullptr;
 
  378             else if(!calo_id->is_tile_gapscin(
cell->ID())) {
 
  382                 if(calo_id->is_tile_barrel(
cell->ID()))
 
  387             else if(calo_id->is_tile_gapscin(
cell->ID())) {
 
  394         catch(std::runtime_error& 
err) {
 
  396             std::cout << 
"RunTime exception caught! --> " << 
err.what() << std::endl;
 
  404     std::vector<std::string> searchOrder;
 
  405     searchOrder.push_back(
"TileRawChannelOpt2");
 
  406     searchOrder.push_back(
"TileRawChannelOpt");
 
  407     searchOrder.push_back(
"TileRawChannelFixed");
 
  408     searchOrder.push_back(
"TileRawChannelFitCool");
 
  409     searchOrder.push_back(
"TileRawChannelFit");
 
  410     searchOrder.push_back(
"TileRawChannelCnt");
 
  411     searchOrder.push_back(
"TileRawChannelFlt");
 
  413     for(
size_t i=0; 
i<searchOrder.size(); ++
i) {
 
  414         std::string searchString = searchOrder[
i];
 
  415         for(
size_t ii=0; ii<inputKeys.size(); ++ii)
 
  416             if(inputKeys[ii]==searchString)
 
  420     return std::string(
"");
 
  430 :
IVP13DSystemSimple(
"Cells",
"Display energy of CaloCell objects",
"tsulaia@mail.cern.ch or rbianchi@cern.ch"),
 
  457     std::cout <<
" Connecting to CVRC" <<std::endl;
 
  537     } 
catch(std::runtime_error& 
err) {
 
  551         if(
it->second) 
delete it->second;
 
  559         if(itSepHelper->second) 
delete itSepHelper->second;
 
  579     std::vector<std::string>::const_iterator firstKey, lastKey;
 
  583     std::vector<std::string> strCaloCellKeys;
 
  585     firstKey = strCaloCellKeys.begin();
 
  586     lastKey = strCaloCellKeys.end();
 
  589     if(firstKey!=lastKey) {
 
  591         std::string keyCaloCell = *firstKey;
 
  599                 SoSeparator* childSep = 
new SoSeparator();
 
  603                 root->addChild(childSep);
 
  611             message(
"Unable to retrieve Calo Cells from Store Gate for this event");
 
  613         while(++firstKey!=lastKey)
 
  614             messageDebug(
"Another Calo Cell collection found in the SG with key = " + QString((*firstKey).c_str()));
 
  616         message(
"No Calo Cells in Store Gate for this event");     
 
  637         std::vector<std::string> strLArDigitKeys;
 
  639         firstKey = strLArDigitKeys.begin();
 
  640         lastKey = strLArDigitKeys.end();
 
  642         if(firstKey==lastKey){
 
  643             message(
"No LAr Digits in Store Gate for this event");
 
  646             std::string strLArDigitKeys(
""), tagThinned(
""), tagIIC(
""), tagFirstOther(
"");
 
  648             for(;firstKey!=lastKey;++firstKey) {
 
  649                 if((*firstKey).find(
"Thinned")!=std::string::npos)
 
  650                     tagThinned = *firstKey;
 
  651                 else if((*firstKey).find(
"IIC")!=std::string::npos)
 
  653                 else if(tagFirstOther==
"")
 
  654                     tagFirstOther = *firstKey;
 
  657             if(tagFirstOther!=
"")
 
  658                 strLArDigitKeys = tagFirstOther;
 
  659             else if(tagThinned!=
"")
 
  660                 strLArDigitKeys = tagThinned;
 
  662                 strLArDigitKeys = tagIIC;
 
  664             QString mess = QString(
"Retrieving LArDigitContainer with the key ") + QString(strLArDigitKeys.c_str());
 
  671                 std::ostringstream numLarDigits;
 
  673                 message(
"Number of LAr digits for this event " + QString(numLarDigits.str().c_str()));
 
  675                 message(
"Unable to retrieve LAr digits from Store Gate for this event");
 
  685         std::vector<std::string> strTileDigitKeys;
 
  687         firstKey = strTileDigitKeys.begin();
 
  688         lastKey = strTileDigitKeys.end();
 
  690         if(firstKey==lastKey){
 
  691             message(
"No Tile Digits in Store Gate for this event");
 
  694             std::string keyTileDigits = *firstKey;
 
  698                 message(
"Unable to retrieve Tile digits from Store Gate for this event");
 
  705                 std::vector<std::string> strTileRawchanKeys;
 
  707                 firstKey = strTileRawchanKeys.begin();
 
  708                 lastKey = strTileRawchanKeys.end();
 
  710                 if(firstKey==lastKey) {
 
  711                     message(
"No Tile Raw Channels in Store Gate for this event");
 
  717                     if(keyTileRawChan==
"")
 
  718                         keyTileRawChan = *firstKey;
 
  720                     QString mess = QString(
"Retrieving Tile Raw Channels with the key ") + QString(keyTileRawChan.c_str());
 
  725                         message(
"Unable to retrieve Tile raw channels from Store Gate for this event");
 
  740     SoSeparator* mbtsSeparator = 
new SoSeparator;
 
  741     root->addChild(mbtsSeparator);
 
  745     } 
catch(std::runtime_error& 
err) {
 
  756     SoNode* 
tail = pickedPath->getTail();
 
  768         std::string channel_string = 
"";
 
  774                 std::ostringstream idstring;
 
  788                 channel_string = idstring.str();
 
  792                     hwId = 
cabling->createSignalChannelID(cellOffline);
 
  794                     message(
"LArID Exception caught while creating signal channel id");
 
  803         std::vector<std::string> 
msg;
 
  806         } 
catch(std::runtime_error& 
err) {
 
  811         for(
unsigned int ii=0; ii<
msg.size(); ++ii)
 
  828                         hwId = 
cabling->createSignalChannelID(cellOffline);
 
  830                         message(
"EXCEPTION!! LArIDException caught while creating signal channel id!!");
 
  837                         if((*itLArDig)->hardwareID()==hwId) {
 
  839                             message(
"displaying LAr digits...");
 
  843                                         (*itLArDig)->samples(),
 
  847                                 std::cout << 
"ERROR!!! Exception caught! --> " << 
e.what() << std::endl;
 
  848                                 QString 
title = 
"ERROR!!! Exception caught!";
 
  849                                 QString mex = 
"While displaying LAr digits, an exception has been caught!\n\nException details:\n\n" + QString::fromStdString(
e.what());
 
  850                                 messageDebug(
"Clearing the DigitForm and returning...");
 
  854                                 QMessageBox::warning( widget, 
title,
 
  868                     message(
"Unable to find digits for the selected cell");
 
  870                     message(
"LAr digit display not available");
 
  886                     int frag1, channel1, frag2, channel2;
 
  896                             if((*itTileDig)->size() >0 && (*itTileDig)->identify()==frag1) {
 
  898                                 digits1 = (**itTileDig)[channel1];
 
  902                                 if(channel2==channel1) {
 
  906                                         if((*itTileDig)->size() >0 && (*itTileDig)->identify()==frag2) {
 
  907                                             digits2 = (**itTileDig)[channel2];
 
  913                                     digits2 = (**itTileDig)[channel2];
 
  918                                     message(
"Unable to find digits for the PMT 1");
 
  933                             message(
"Unable to find digits for the PMT 0");
 
  946                             if((*itTileRawCh)->size()>0 && (*itTileRawCh)->identify()==frag1) {
 
  947                                 rawchannel1 = (**itTileRawCh)[channel1];
 
  951                                 if(channel2==channel1) {
 
  956                                         if((*itTileRawCh)->size()>0 && (*itTileRawCh)->identify()==frag2) {
 
  966                                 rawchannel2 = (**itTileRawCh)[channel2];
 
  969                                     message(
"Unable to get raw channel for PMT1");
 
  974                                 std::cout << 
"debug vars :" << rawchannel1 << 
" - " <<  rawchannel2 << std::endl;
 
  976                                 std::cout << digits1->
samples().size() << std::endl;
 
  983                                     std::cout << 
"ERROR!!! Exception caught from Tile! --> " << 
e.what() << std::endl;
 
  984                                     QString 
title = 
"ERROR!!! Exception caught!";
 
  985                                     QString mex = 
"While displaying Tile Pulse, an exception has been caught!\n\nException details:\n\n" + QString::fromStdString(
e.what());
 
  986                                     messageDebug(
"Clearing the DigitForm and returning...");
 
  990                                     QMessageBox::warning( widget, 
title,
 
 1005                         if(rawchannel1==0) {
 
 1006                             message(
"Unable to get raw channel for PMT0");
 
 1012                     message(
"Unable to get drawer and channel IDs");
 
 1014                     message(
"Tile digit display not available");
 
 1035                             if((*itTileDig)->size() >0 && (*itTileDig)->identify()==frag) {
 
 1036                                 digits = (**itTileDig)[
channel];
 
 1045                             message(
"Unable to find digits");
 
 1056                             if((*itTileRawCh)->size()>0 && (*itTileRawCh)->identify()==frag) {
 
 1057                                 rawchannel = (**itTileRawCh)[
channel];
 
 1062                             message(
"Unable to get raw channel");
 
 1066                     message(
"Unable to get drawer and channel ID");
 
 1068                     message(
"Tile digit display not available");
 
 1083     for(
unsigned int ii=0; ii<
msg.size(); ++ii)
 
 1104     if (
state.version()!=0) {
 
 1105         message(
"Warning: State data in .vp1 file is in wrong format - ignoring!");
 
 1114     state.disableUnrestoredChecks();
 
 1131         if(it_ccman->second) 
delete it_ccman->second;
 
 1144         itSepHelp->second->largeChangesBegin();
 
 1156         it->second->selectionUpdated(intervals);
 
 1161         itSepHelp->second->largeChangesEnd();