Try 
```
  // Fill output collections if valid input collections are available.                                                                                                   
  if (wireDigis.isValid() && compDigis.isValid()) {
    std::shared_ptr<const CSCBadChambers> temp( checkBadChambers_ ?
                                                std::shared_ptr<const CSCBadChambers>{pBadChambers.product(), [](const void*){}} :
                                                std::make_shared<const CSCBadChambers>());
    lctBuilder_->build(temp.get(),
                       wireDigis.product(), compDigis.product(), gemPads,
                       *oc_alct, *oc_clct, *oc_pretrig, *oc_lct, *oc_sorted_lct);
  }
```
Where I'm not passing any arguments to ```std::make_shared``` and I do ```temp.get()``` to get the pointer when calling ```lctBuilder_->build()```